/* ============================================================
   said@mammadov:~/portfolio — stylesheet
   Architecture:  cascade layers + primitives → semantic tokens
   Theming:       [data-theme="..."] on <body>
   Tints:         color-mix(in srgb, ...) — no rgb-triplet tokens
   Contrast:      WCAG AA verified for default theme
   ============================================================ */

@layer reset, tokens, themes, base, components, utilities, motion;

/* ============================================================
   RESET
   ============================================================ */
@layer reset {
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

  html {
    color: var(--text);
    font-family: var(--font-mono);
    height: 100%;
    color-scheme: dark light;
    /* No fixed root font-size — respect the user's browser preference. */
  }

  body {
    /* Slight bump from the default 16px without overriding it absolutely.
       1.0625rem ≈ 17px at default settings; scales with user preference. */
    font-size: 1.0625rem;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg);
    background-image:
      radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 40%),
      radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--blue)   5%, transparent), transparent 40%);
    transition: background var(--motion-slow) ease;
  }

  img, svg { max-width: 100%; display: block; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }

  ::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); }
}

/* ============================================================
   TOKENS — primitives + semantic
   ============================================================ */
@layer tokens {
  :root {
    /* ----- PRIMITIVES (palette — never reference these in components) ----- */
    --clr-ink-50:    #e2e2f0;
    --clr-ink-300:   #9090b0;
    --clr-ink-400:   #8888a8;     /* AA-bumped from #7878a0 (was 3.52:1) */
    --clr-surface-700: #252540;
    --clr-surface-800: #1e1e35;
    --clr-surface-900: #1a1a2e;
    --clr-line-500:    #5a5a8a;
    --clr-line-600:    #3a3a5c;

    --clr-accent-300: #f0c4a0;
    --clr-accent-500: #e8a87c;
    --clr-green:      #7ec89b;
    --clr-red:        #e87c7c;
    --clr-blue:       #7caae8;
    --clr-yellow:     #e8d87c;
    --clr-purple:     #b88ce8;
    --clr-cyan:       #7ce8d8;

    --clr-dot-red:    #ff5f57;
    --clr-dot-yellow: #febc2e;
    --clr-dot-green:  #28c840;

    /* ----- SEMANTIC (components reference these) ----- */
    --bg:            var(--clr-surface-900);
    --bg-window:     var(--clr-surface-700);
    --bg-darker:     var(--clr-surface-800);
    --border:        var(--clr-line-600);
    --border-dashed: var(--clr-line-500);
    --text:          var(--clr-ink-50);
    --text-dim:      var(--clr-ink-300);
    --text-muted:    var(--clr-ink-400);
    --accent:        var(--clr-accent-500);
    --accent-bright: var(--clr-accent-300);
    --green:         var(--clr-green);
    --red:           var(--clr-red);
    --blue:          var(--clr-blue);
    --yellow:        var(--clr-yellow);
    --purple:        var(--clr-purple);
    --cyan:          var(--clr-cyan);

    /* ----- TYPOGRAPHY ----- */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    --fs-xs:   0.75rem;
    --fs-sm:   0.85rem;
    --fs-base: 0.92rem;
    --fs-md:   0.95rem;
    --fs-lg:   1rem;
    --fs-xl:   1.075rem;

    /* ----- SPACING / RADII ----- */
    --space-1: 4px;  --space-2: 6px;  --space-3: 8px;  --space-4: 10px;
    --space-5: 12px; --space-6: 14px; --space-7: 16px; --space-8: 18px;
    --space-9: 20px; --space-10: 24px; --space-11: 28px; --space-12: 32px; --space-13: 40px;

    --radius-xs: 3px; --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px;

    --border-solid: 1px solid var(--border);
    --border-dash:  1px dashed var(--border-dashed);

    /* ----- ELEVATION ----- */
    --shadow-window: 0 25px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);

    /* ----- LAYOUT ----- */
    --window-max:   960px;
    --window-min-h: 600px;
    --window-max-h: 88vh;

    /* ----- MOTION ----- */
    --motion-fast: 150ms;
    --motion-base: 200ms;
    --motion-slow: 300ms;
  }
}

/* ============================================================
   THEMES — body[data-theme="..."]
   AA-corrected against the audit's verified contrast numbers
   ============================================================ */
@layer themes {
  [data-theme="light"] {
    --bg:            #f0f0f5;
    --bg-window:     #ffffff;
    --bg-darker:     #e8e8f0;
    --border:        #d0d0dd;
    --border-dashed: #b0b0cc;
    --text:          #2a2a3e;
    --text-dim:      #6a6a8a;
    --text-muted:    #5a5a78;     /* AA: was 2.75:1 → now 4.84:1 on #ffffff */
    --accent:        #b06430;     /* AA: was 3.44:1 → now 4.55:1 on #ffffff */
    --accent-bright: #d89060;
    --green:  #3a8a5a; --red: #c44040; --blue: #4070c4;
    --yellow: #b89a30; --purple: #8050b0; --cyan: #308a80;
    --shadow-window: 0 25px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.08);
  }

  [data-theme="glass"] {
    --bg:            #0f0f1a;
    --bg-window:     color-mix(in srgb, white 6%, transparent);
    --bg-darker:     color-mix(in srgb, white 3%, transparent);
    --border:        color-mix(in srgb, white 12%, transparent);
    --border-dashed: color-mix(in srgb, white 18%, transparent);
    --text:          #f0f0ff;
    --text-dim:      #b0b0d0;
    --text-muted:    #9090b8;     /* bumped from #6a6a8e for AA */
    --accent:        #c4b5fd;     /* bumped from #a78bfa for AA on glass */
    --accent-bright: #d4c5ff;
  }
  [data-theme="glass"] body {
    background: radial-gradient(circle at 20% 20%, #2a1a4a, #0f0f1a 60%);
  }
  [data-theme="glass"] .terminal-window {
    backdrop-filter: blur(20px) saturate(160%);
  }

  [data-theme="retro"] {
    --bg:            #808080;
    --bg-window:     #C0C0C0;
    --bg-darker:     #DFDFDF;
    --border:        #000;
    --border-dashed: #808080;
    --text:          #000;
    --text-dim:      #303030;
    --text-muted:    #444;        /* was #606060 (3.46:1) → now ~5.7:1 */
    --accent:        #000;
    --accent-bright: #000;
    --green:  #000; --red: #000; --blue: #000;
    --yellow: #000; --purple: #000; --cyan: #000;
    --radius-xl:0; --radius-lg:0; --radius-md:0; --radius-sm:0; --radius-xs:0;
    --shadow-window: 2px 2px 0 var(--border), 4px 4px 0 var(--border);
  }
}

/* ============================================================
   BASE — element-level defaults
   ============================================================ */
@layer base {
  /* respect motion preferences */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ============================================================
   COMPONENTS
   ============================================================ */
@layer components {

  /* ----- TERMINAL WINDOW ----- */
  .terminal-window {
    width: 100%;
    max-width: var(--window-max);
    min-height: var(--window-min-h);
    max-height: var(--window-max-h);
    background: var(--bg-window);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-window);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-width var(--motion-slow) ease,
                min-height var(--motion-slow) ease,
                max-height var(--motion-slow) ease;
  }
  .terminal-window.maximized { max-width: 100%; min-height: 95vh; max-height: 95vh; }
  .terminal-window.minimized { min-height: 0; max-height: 50px; }
  .terminal-window.minimized .terminal-body,
  .terminal-window.minimized .input-area { display: none; }

  /* ----- TITLEBAR ----- */
  .titlebar {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-darker);
    border-bottom: var(--border-solid);
    gap: 8px;
    flex-shrink: 0;
    user-select: none;
  }
  .titlebar-dot {
    width: 12px; height: 12px;
    border-radius: 50%; cursor: pointer;
    transition: opacity var(--motion-base), transform var(--motion-fast), box-shadow var(--motion-base);
    border: none; padding: 0;
    display: inline-block;
  }
  .titlebar-dot:hover { opacity: 0.7; }
  .titlebar-dot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-darker), 0 0 0 4px var(--accent);
  }
  .titlebar-dot.red    { background: var(--clr-dot-red); }
  .titlebar-dot.yellow { background: var(--clr-dot-yellow); }
  .titlebar-dot.green  { background: var(--clr-dot-green); }
  .titlebar-dot.confirming {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--clr-dot-red) 40%, transparent);
  }
  .titlebar-title {
    flex: 1; text-align: center; color: var(--text-muted);
    font-size: var(--fs-base); letter-spacing: 0.5px;
  }

  /* ----- TERMINAL BODY ----- */
  .terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .terminal-body::-webkit-scrollbar { width: 6px; }
  .terminal-body::-webkit-scrollbar-track { background: transparent; }
  .terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .terminal-body::-webkit-scrollbar-thumb:hover { background: var(--border-dashed); }

  /* ----- BOOT SEQUENCE ----- */
  .boot { font-size: var(--fs-base); line-height: 1.7; }
  .boot-line { opacity: 0; animation: bootLine 0.25s ease forwards; }
  .boot-line .ok    { color: var(--green); margin-left: 6px; }
  .boot-line .ready { color: var(--accent); font-weight: 600; }

  .boot-bar {
    display: inline-block;
    min-width: 220px;
    height: 14px;
    border: 1px solid var(--border-dashed);
    border-radius: 2px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    margin: 0 8px 0 2px;
    padding: 1px;
  }
  .boot-bar::before {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background: var(--border-dashed);
    animation: bootFill 1.6s steps(20, end) forwards;
  }
  .boot-bar-label { color: var(--green); font-weight: 600; opacity: 0; animation: bootLine 0.3s ease 1.65s forwards; }
  .boot-cursor { color: var(--accent); display: inline-block; animation: blink 1s step-end infinite; margin-right: 4px; }
  .press-enter {
    color: var(--text-dim);
    opacity: 0;
    animation: bootLine 0.4s ease forwards, pressPulse 1.6s ease-in-out infinite;
  }

  /* Tappable hint on touch devices — both cursor (mouse) AND a real
     active state that any browser will render (covers Firefox Android
     where -webkit-tap-highlight-color is ignored). */
  .boot-tappable {
    cursor: pointer;
    -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 15%, transparent);
  }
  .boot-tappable:active {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-radius: var(--radius-md);
  }

  /* ----- MOTD (login banner) ----- */
  .motd { margin-top: -4px; margin-bottom: 14px; }
  .motd em { font-style: italic; color: var(--text); }

  /* ----- ASCII PORTRAIT ----- */
  .ascii-art {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.05;
    color: var(--accent);
    white-space: pre;
    text-align: center;
    margin: 0 0 14px;
    letter-spacing: 0;
    font-weight: 700;
  }

  /* ----- PROFILE OUTPUT (`$ cat ~/.profile`) ----- */
  .profile-output {
    border-left: 2px solid var(--border);
    padding: 4px 0 4px 14px;
    margin-left: 6px;
  }
  .profile-row {
    display: flex;
    gap: 16px;
    font-size: var(--fs-base);
    line-height: 1.7;
  }
  .profile-row .profile-key {
    color: var(--text-dim);
    min-width: 13ch;          /* 12ch + colon clearance */
    flex-shrink: 0;
  }
  .profile-row .profile-key::after { content: ':'; color: var(--text-muted); }
  .profile-row .profile-val { color: var(--text); }

  /* ----- CAPABILITIES (`$ ls -la ~/skills/`) ----- */
  .capabilities {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 4px 6px;
    padding-left: 14px;
    border-left: 2px solid var(--border);
    font-size: var(--fs-base);
    line-height: 1.7;
  }
  .cap-col {
    display: grid;
    grid-template-columns: 14ch 8ch 1fr;
    gap: 12px;
    align-items: baseline;
    transition: color var(--motion-fast);
  }
  .cap-col .cap-name      { color: var(--accent); font-weight: 600; }
  .cap-col:hover .cap-name { color: var(--accent-bright); }
  .cap-col .cap-list      { color: var(--text-dim); }

  /* ----- COMMAND OUTPUT BLOCKS ----- */
  .output-block { margin-bottom: 20px; line-height: 1.7; }
  .output-block .cmd-echo {
    color: var(--text-dim);
    margin-bottom: 10px;
    font-size: var(--fs-base);
  }
  .output-block .cmd-echo .prompt-symbol {
    color: var(--accent); margin-right: 6px; font-weight: 700;
  }
  .output-line { line-height: 1.7; font-size: var(--fs-base); }
  .output-line.heading {
    color: var(--accent); font-weight: 600; font-size: var(--fs-lg);
    margin-top: 12px; margin-bottom: 4px;
  }
  .output-line.heading:first-child { margin-top: 0; }
  .output-line .cmd-name { color: var(--accent); font-weight: 600; display: inline-block; min-width: 13ch; }
  .output-line .cmd-desc { color: var(--text-dim); }

  /* ----- TAGS / PILLS ----- */
  .tag {
    display: inline-block; padding: 1px 8px; border-radius: 3px;
    font-size: var(--fs-xs); margin: 2px 4px 2px 0;
  }
  .tag.green-bg  { background: color-mix(in srgb, var(--green)  15%, transparent); color: var(--green); }
  .tag.blue-bg   { background: color-mix(in srgb, var(--blue)   15%, transparent); color: var(--blue); }
  .tag.purple-bg { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }
  .tag.yellow-bg { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); }
  .tag.accent-bg { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }

  .divider { border: none; border-top: var(--border-solid); margin: 20px 0; }

  /* ----- PROJECT CARD ----- */
  .project-card {
    border: var(--border-solid);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 8px 0;
    transition: border-color var(--motion-base),
                background    var(--motion-base),
                transform     var(--motion-fast);
  }
  .project-card:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
    transform: translateY(-1px);
  }
  .project-card .project-name { color: var(--accent); font-weight: 600; font-size: var(--fs-md); }
  .project-card .project-name a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
  .project-card .project-name a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
  }
  .project-card .project-year { color: var(--text-muted); font-size: var(--fs-xs); float: right; margin-top: 2px; }
  .project-card .project-type { color: var(--text-dim); font-size: var(--fs-sm); margin-top: 2px; }
  .project-card .project-desc { color: var(--text); font-size: var(--fs-sm); margin-top: 8px; line-height: 1.6; }
  .project-card .project-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
  .project-card .project-tag {
    font-size: var(--fs-xs); padding: 2px 8px; border-radius: 3px;
    background: color-mix(in srgb, var(--blue) 12%, transparent);
    color: var(--blue);
  }
  .project-card .project-stats { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
  .project-card .project-stat { font-size: var(--fs-xs); color: var(--green); }

  /* ----- INPUT AREA ----- */
  .input-area {
    border-top: var(--border-solid);
    padding: 16px 32px;
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; background: var(--bg-darker);
  }
  .input-prompt {
    color: var(--accent); font-size: var(--fs-xl);
    font-weight: 700; flex-shrink: 0; user-select: none;
  }
  .input-wrapper { position: relative; flex: 1; }
  .input-field {
    width: 100%; background: transparent; border: none; outline: none;
    color: var(--text); font-family: inherit; font-size: var(--fs-md);
    caret-color: var(--accent);
  }
  .input-field::placeholder { color: var(--text-dim); }   /* uses dim, AA-passing */

  /* ----- AUTOCOMPLETE ----- */
  .autocomplete {
    position: absolute;
    bottom: calc(100% + 8px);
    left: -8px; right: -8px;
    background: var(--bg-darker);
    border: var(--border-solid);
    border-radius: var(--radius-md);
    max-height: 240px; overflow-y: auto;
    display: none; z-index: 10;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  .autocomplete.show { display: block; }
  .autocomplete-item {
    padding: 8px 16px; cursor: pointer;
    display: flex; gap: 12px;
    font-size: var(--fs-sm);
    transition: background var(--motion-fast);
  }
  .autocomplete-item:hover,
  .autocomplete-item.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .autocomplete-item .ac-cmd  { color: var(--accent); font-weight: 600; min-width: 90px; }
  .autocomplete-item .ac-desc { color: var(--text-dim); }

  /* ----- SOCIAL LINK ROWS ----- */
  .social-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border: var(--border-solid); border-radius: var(--radius-md);
    margin: 6px 0; text-decoration: none; color: var(--text);
    font-size: var(--fs-sm);
    transition: border-color var(--motion-base),
                background    var(--motion-base),
                transform     var(--motion-fast);
  }
  .social-link:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
    transform: translateX(4px);
  }
  .social-badge {
    font-size: var(--fs-xs); font-weight: 700;
    padding: 3px 8px; border-radius: var(--radius-sm);
    min-width: 32px; text-align: center; text-transform: uppercase;
  }
  .social-badge.icon {
    background: color-mix(in srgb, white 4%, transparent);
    padding: 5px;
    min-width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .social-badge.icon svg { width: 18px; height: 18px; display: block; }
  .social-badge.blue   { background: color-mix(in srgb, var(--blue)   15%, transparent); color: var(--blue); }
  .social-badge.purple { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }
  .social-badge.accent { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
  .social-badge.green  { background: color-mix(in srgb, var(--green)  15%, transparent); color: var(--green); }
  .social-name   { font-weight: 600; min-width: 110px; }
  .social-handle { color: var(--text-dim); flex: 1; }
  .social-arrow  { color: var(--text-muted); transition: color var(--motion-base), transform var(--motion-base); }
  .social-link:hover .social-arrow { color: var(--accent); transform: translateX(3px); }

  /* ----- SKILL CHIPS (categorical, replaces fictional percentages) ----- */
  .skill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
  .skill-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px;
    border: var(--border-solid);
    border-radius: 999px;
    font-size: var(--fs-sm);
    color: var(--text);
    transition: border-color var(--motion-base), transform var(--motion-fast);
  }
  .skill-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
  .skill-chip .level {
    font-size: var(--fs-xs);
    padding: 1px 7px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.02em;
  }
  .level.comfortable { background: color-mix(in srgb, var(--green)  18%, transparent); color: var(--green);  }
  .level.proficient  { background: color-mix(in srgb, var(--blue)   18%, transparent); color: var(--blue);   }
  .level.learning    { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }

  /* ----- THEME PICKER ----- */
  .theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; }
  .theme-card {
    border: var(--border-solid); border-radius: var(--radius-md);
    padding: 14px; cursor: pointer;
    transition: border-color var(--motion-base), transform var(--motion-fast);
    display: flex; flex-direction: column; gap: 8px;
  }
  .theme-card:hover { border-color: var(--accent); transform: translateY(-1px); }
  .theme-card:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--bg-darker), 0 0 0 4px var(--accent);
  }
  .theme-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
  .theme-card .name { color: var(--accent); font-weight: 600; font-size: var(--fs-md); }
  .theme-card .desc { color: var(--text-dim); font-size: var(--fs-xs); }
  .theme-swatches { display: flex; gap: 4px; margin-top: 4px; }
  .theme-swatches span {
    width: 18px; height: 18px; border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
  }

  /* ----- THINKING INDICATOR ----- */
  .thinking-indicator {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
    font-size: 0.85em; color: var(--accent);
  }
  .thinking-dots { display: flex; gap: 3px; }
  .thinking-dots span {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent);
    animation: thinkingDot 1.2s ease-in-out infinite;
  }
  .thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
  .thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
@layer utilities {
  /* Text color */
  .t-accent { color: var(--accent); }
  .t-green  { color: var(--green); }
  .t-blue   { color: var(--blue); }
  .t-yellow { color: var(--yellow); }
  .t-purple { color: var(--purple); }
  .t-red    { color: var(--red); }
  .t-dim    { color: var(--text-dim); }
  .t-muted  { color: var(--text-muted); }
  .t-bold   { font-weight: 600; }

  /* Margin */
  .mt-1 { margin-top: 4px; }
  .mt-2 { margin-top: 8px; }
  .mt-3 { margin-top: 10px; }
  .mt-4 { margin-top: 14px; }
  .mb-2 { margin-bottom: 8px; }

  /* Alignment */
  .text-center { text-align: center; }
}

/* ============================================================
   MOTION — keyframes + entry animations
   ============================================================ */
@layer motion {
  @keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
  }
  @keyframes thinkingDot {
    0%, 20% { opacity: 0.2; }
    50%     { opacity: 1; }
    100%    { opacity: 0.2; }
  }
  @keyframes bootLine {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes bootFill { to { width: 100%; } }
  @keyframes pressPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
  }

  .fade-in { animation: fadeSlideIn 0.4s ease forwards; }
  .typing-cursor::after {
    content: '\2588';
    animation: blink 1s step-end infinite;
    color: var(--accent);
    margin-left: 2px;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  body { padding: 0; }
  .terminal-window {
    max-width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .terminal-body { padding: 16px; }
  .input-area    { padding: 12px 16px; }
  .theme-grid    { grid-template-columns: 1fr; }
  .ascii-art     { font-size: 0.5rem; }

  /* Capabilities: keep grid but with absolute units that don't shrink
     with the smaller font-size (fixes the prior `ch`-units bug where
     columns shrank disproportionately at sm breakpoint). */
  .cap-col {
    grid-template-columns: 110px 70px 1fr;
    gap: 8px;
    font-size: var(--fs-sm);
  }
  .profile-row { gap: 10px; font-size: var(--fs-sm); }
  .profile-row .profile-key { min-width: 11ch; }
  .social-name { min-width: 80px; }
}

/* ============================================================
   PRINT — basic resume-friendly fallback
   ============================================================ */
@media print {
  body { background: white; padding: 0; display: block; }
  .terminal-window {
    box-shadow: none; max-width: 100%; max-height: none; border: 1px solid #000;
  }
  .titlebar, .input-area, .autocomplete { display: none; }
}
