* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --text: #e5e5e5;
    --text-muted: #666;
    --accent: #c9a227;
    --accent-dim: #8a6f1a;
    --border: #222;
    --terminal-bg: #0d1117;
    --green: #4ade80;
    --red: #f87171;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 0;
    margin: 0;
    background-image: 
        radial-gradient(ellipse at top, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(201, 162, 39, 0.02) 0%, transparent 30%);
}

.container {
    max-width: 69%;
    width: 69%;
    margin: 0 auto;
    padding: 0 2rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative; /* For absolute positioning of theme switch */
}

/* Rainbow Mode Support handled via JS variables now */
.coffee-icon {
    font-size: 2.2rem;
    cursor: pointer;
    display: inline-block;
    vertical-align: bottom;
    transition: transform 0.2s ease, filter 0.2s linear;
    position: relative;
    user-select: none;
    margin: 0 -0.12em;
    z-index: 10;
    /* Default to no filter, controlled by --emoji-filter variable */
    filter: var(--emoji-filter, none);
}

.coffee-icon:hover {
    animation: wiggle 0.5s ease;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.steam-particle {
    position: absolute;
    top: -10px;
    left: 50%;
    color: var(--text-muted);
    font-size: 1.5rem;
    animation: steam 1s ease-out forwards;
    pointer-events: none;
}

@keyframes steam {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) translateX(-50%);
    }
}

h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    position: relative;
}

/* Glitch Effect - Removed / Simplified to just accent color */
.coffee-fill {
    color: var(--accent);
    position: relative;
    transition: color 0.3s ease;
}

.domain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* Typing Animation */
.tagline {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    min-height: 1.5em;
}

.typing-text {
    display: inline;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--accent);
    display: inline;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Terminal Style About Section */
.about {
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 2.5rem 2rem;
    background: var(--surface);
    margin-bottom: 0;
}

.terminal {
    background: var(--terminal-bg);
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.terminal-header {
    background: var(--surface);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.terminal-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.terminal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 0.2s;
    line-height: 1;
}

.terminal-btn:hover {
    color: var(--accent);
}

.terminal-title {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.terminal-body {
    padding: 1rem;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.terminal-body p {
    margin: 0;
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--terminal-bg);
}

.input-field {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    flex: 1;
    margin-left: 0.5rem;
    outline: none;
    caret-color: var(--accent);
}

.input-field::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.prompt {
    color: var(--green);
    margin-right: 0.5rem;
}

.output {
    color: var(--text-muted);
    padding-left: 1.2rem;
    white-space: pre-wrap;
}

.highlight {
    color: var(--accent);
    font-weight: 500;
}

.secondary {
    color: var(--green);
    display: block;
    margin: 0.3rem 0 0.8rem 0;
}

.category {
    color: var(--accent);
    font-weight: 500;
}

.cmd {
    color: var(--green);
    font-weight: 500;
}

.error {
    color: #f87171;
}

.cursor-blink {
    animation: blink 1s infinite;
    color: var(--green);
}

/* Contact Section */
.contact {
    margin-bottom: 0;
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 2.5rem 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.contact h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.form-group input,
.form-group textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

#contact-form button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    padding: 0.85rem 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

#contact-form button:hover {
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3);
}

#contact-form button:active {
    transform: scale(0.98);
}

#contact-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.form-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    min-height: 1.5em;
    font-family: 'JetBrains Mono', monospace;
}

.form-status.success {
    color: var(--green);
}

.form-status.error {
    color: var(--red);
}

/* Footer */
footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.easter-hint {
    margin-top: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem !important;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.easter-hint:hover {
    opacity: 0.6;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    color: var(--text);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 1.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .terminal {
        font-size: 0.75rem;
    }

    .coffee-icon {
        font-size: 2.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0;
    }

    .container {
        max-width: 100%;
        padding: 0 1rem;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }

    header h1 {
        font-size: 2rem;
        order: 1;
    }

    .theme-switch {
        position: absolute;
        top: 0;
        right: 0;
    }

    .tagline {
        font-size: 1rem;
        order: 2;
    }

    .terminal-body {
        max-height: 300px;
        font-size: 0.8rem;
    }

    .input-field {
        font-size: 0.8rem;
    }

    .terminal-title {
        font-size: 0.75rem;
    }

    .terminal-btn {
        font-size: 1rem;
    }

    .contact h2 {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 1rem;
    }

    button {
        font-size: 0.9rem;
    }

    .ahu-modal {
        padding: 0.5rem;
    }

    .ahu-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    header h1 {
        font-size: 1.5rem;
        width: 100%;
        text-align: center;
        padding-right: 2.5rem; /* Make room for theme switch */
    }

    /* Hide the paint emoji button on mobile, use coffee as toggle */
    .theme-switch {
        display: none;
    }

    .coffee-icon {
        font-size: 1.4rem;
        /* Coffee emoji becomes the theme toggle on mobile */
    }

    .tagline {
        font-size: 0.9rem;
    }

    .terminal {
        font-size: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .terminal-body {
        max-height: 250px;
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .terminal-input {
        padding: 0.5rem;
    }

    .input-field {
        font-size: 0.7rem;
    }

    .prompt {
        margin-right: 0.25rem;
    }

    .terminal-title {
        font-size: 0.65rem;
    }

    .terminal-btn {
        font-size: 0.9rem;
    }

    .contact h2 {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    button {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    footer {
        font-size: 0.7rem;
    }

    .ahu-title {
        font-size: 0.7rem;
    }

    .ahu-status {
        flex-direction: column;
        gap: 0.5rem;
    }

    .status-item {
        flex-direction: column;
    }
}

/* Theme Definitions */
:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --text: #e5e5e5;
    --text-muted: #666;
    --accent: #c9a227;
    --accent-dim: #8a6f1a;
    --border: #222;
    --terminal-bg: #0d1117;
    --green: #4ade80;
    --red: #f87171;
}

body.theme-rainbow {
    /* Rainbow cycling handled by JS for state persistence */
     /* animation: rainbow-cycle 5s linear infinite; - Moved to JS */
}

@keyframes rainbow-cycle {
    0% { --accent: #ff0000; }
    14% { --accent: #ff7f00; }
    28% { --accent: #ffff00; }
    42% { --accent: #00ff00; }
    57% { --accent: #0000ff; }
    71% { --accent: #4b0082; }
    85% { --accent: #9400d3; }
    100% { --accent: #ff0000; }
}

/* Because CSS variables in animations support is spotty or doesn't interpolate well for all browsers without @property, 
   we might need to target specific properties if the variable interpolation fails. 
   However, modern browsers support animating registered custom properties.
   Alternatively, we can just apply the animation to the color/fill properties directly or rely on a class that updates via JS. 
   
   Let's try the modern CSS @property approach for smooth interpolation if supported, 
   otherwise I will use a keyframe on the elements themselves or accept discrete steps.
*/

@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #c9a227;
}

.theme-switch {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.theme-switch:hover {
    border-color: var(--accent);
    transform: rotate(15deg);
}
