@layer sections {
  /* ===== HERO ===== */
  .hero { display: flex; align-items: center; justify-content: center; text-align: center; }
  .hero-inner { position: relative; z-index: 2; }

  .hero-title {
    font-family: 'VT323', monospace; font-size: clamp(56px, 12vw, 140px); line-height: 0.95; color: var(--text); letter-spacing: 3px; margin-bottom: var(--sp-4); min-height: 1.1em; text-wrap: balance;

    & .k { color: var(--acid); text-shadow: var(--glow-xl); }
    & .prefix { color: var(--acid); opacity: 0.5; }
  }

  .hero-cursor { display: inline-block; width: 0.35em; height: 0.7em; background: var(--acid); vertical-align: baseline; animation: blink 1s step-end infinite; box-shadow: 0 0 8px var(--acid-40); }
  @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
  .hero-sub { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); letter-spacing: 3px; margin-bottom: var(--sp-2); }
  .hero-line { width: 60px; height: 1px; background: var(--acid); margin: var(--sp-6) auto; opacity: 0.3; }
  .hero-tagline { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

  .scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--acid-30); animation: scrollPulse 2s ease-in-out infinite; }
  @keyframes scrollPulse { 0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); } 50% { opacity: 0.7; transform: translateX(-50%) translateY(6px); } }

  .cmd-hint {
    position: fixed; bottom: 16px; left: 16px; z-index: 100; font-family: var(--font-mono); font-size: 11px; color: var(--acid-20); cursor: pointer; border: 1px solid var(--acid-10); padding: 2px 8px; border-radius: 3px; transition: all var(--ease-normal);

    &:hover { color: var(--acid); border-color: var(--acid-30); }
  }

  /* ===== SCHEMATIC ===== */
  .schematic {
    display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center;
    margin-top: var(--sp-8); font-family: var(--font-mono); overflow: visible;
  }

  .schematic-row, .schematic-v-row { display: contents; }

  .schematic-node {
    border: 1px solid var(--border); padding: var(--sp-5) var(--sp-6); text-align: center; transition: all var(--ease-normal); cursor: default; position: relative; overflow: visible;

    &:hover, &.active {
      z-index: 30; border-color: var(--acid); background: var(--acid-3); box-shadow: var(--glow-box-lg);

      & .detail-panel { display: block; }
    }

    & h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; color: var(--text); margin-bottom: var(--sp-1); }
    & p { font-size: 11px; color: var(--text-dim); }
    & .detail-panel { display: none; position: absolute; top: 100%; left: -1px; right: -1px; border: 1px solid var(--border-bright); border-top: none; background: #050505; padding: var(--sp-4); font-size: 12px; color: var(--text-muted); text-align: left; z-index: 20; line-height: 1.5; }
  }

  .schematic-tentacle {
    display: flex; align-items: center; justify-content: center; height: 30px; overflow: hidden;

    & pre { font-family: var(--font-mono); font-size: 7px; line-height: 1.0; letter-spacing: 0; color: var(--acid); white-space: pre; opacity: 0.4; }
  }

  .schematic-tentacle-v {
    justify-self: center; display: flex; align-items: center; justify-content: center; height: 40px; overflow: hidden;

    & pre { font-family: var(--font-mono); font-size: 7px; line-height: 1.0; letter-spacing: 0; color: var(--acid); white-space: pre; opacity: 0.4; }
  }

  .schematic-v-spacer { /* empty — grid auto column handles width */ }

  /* ===== ARSENAL ===== */
  .arsenal-table {
    width: 100%; font-family: var(--font-mono); font-size: 13px; border-collapse: collapse; margin-top: var(--sp-7);

    & thead th { text-align: left; font-size: 11px; color: var(--text-dim); letter-spacing: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); }
    & tbody td { padding: 6px 0; border-bottom: 1px dotted var(--acid-6); }
    & .tool-group { color: var(--acid); font-weight: 700; width: 160px; letter-spacing: 1px; vertical-align: top; padding-top: 10px; }
    & .tool-list { color: var(--text-muted); padding-top: 10px; }
  }

  /* ===== PROCESS ===== */
  .flow-row {
    display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center;
    margin-top: var(--sp-8); font-family: var(--font-mono);
  }

  .flow-top { display: contents; }

  .flow-box {
    border: 1px solid var(--border); padding: 20px 28px; text-align: center; transition: all var(--ease-normal); cursor: default;

    &:hover { border-color: var(--acid); background: var(--acid-3); }
    & h3 { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; color: var(--text); margin-bottom: var(--sp-1); }
    & .step-num { font-family: var(--font-mono); font-size: 10px; color: var(--acid-30); margin-bottom: var(--sp-2); }
    & p { font-size: 11px; color: var(--text-dim); line-height: 1.4; max-width: 140px; margin: 0 auto; font-family: var(--font-mono); }
  }

  .flow-tentacle {
    display: flex; align-items: center; justify-content: center; height: 30px; overflow: hidden;

    & pre { font-family: var(--font-mono); font-size: 7px; line-height: 1.0; letter-spacing: 0; color: var(--acid); white-space: pre; opacity: 0.4; }
  }

  .flow-tentacle-v {
    grid-column: 5; justify-self: center;
    display: flex; align-items: center; justify-content: center; height: 40px; overflow: hidden;

    & pre { font-family: var(--font-mono); font-size: 7px; line-height: 1.0; letter-spacing: 0; color: var(--acid); white-space: pre; opacity: 0.4; }
  }

  .flow-box-final {
    grid-column: 1 / -1; border-color: var(--border-bright);

    & h3 { font-size: 32px; }
  }

  /* ===== WORK ===== */
  .work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-8); }

  .work-card {
    border: 1px solid var(--border); transition: border-color var(--ease-normal);

    &:hover { border-color: var(--acid-15); }
    & .stack { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-bottom: var(--sp-2); }
    & .brief { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); }
  }

  .work-card-header {
    padding: var(--sp-4) var(--sp-6); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border);

    & h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; color: var(--text); }
  }

  .work-card-body { padding: var(--sp-4) var(--sp-6); }

  .badge { font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; letter-spacing: 1px; }
  .badge-live { background: var(--acid-12); color: var(--acid); }
  .badge-building { background: rgba(255,102,0,0.12); color: var(--warning); }
  .badge-classified { background: rgba(255,0,51,0.1); color: var(--blood); }

  /* ===== CONTACT ===== */
  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-9); margin-top: var(--sp-7); }
  .contact-info { font-family: var(--font-mono); font-size: 14px; }
  .contact-row { display: flex; margin-bottom: var(--sp-4); }
  .contact-label { color: var(--acid); min-width: 110px; opacity: 0.6; }

  .contact-value {
    color: var(--text-muted);

    & a {
      color: var(--electric); text-decoration: none; border-bottom: 1px solid rgba(0,240,255,0.2);

      &:hover { border-bottom-color: var(--electric); }
    }
  }

  /* ===== TERMINAL FORM ===== */
  .terminal-form {
    font-family: var(--font-mono); font-size: 13px; color: var(--acid);

    & .form-prompt { color: var(--acid-40); margin-bottom: var(--sp-3); }

    & .form-field {
      display: flex; align-items: center; margin-bottom: var(--sp-2);

      & span { opacity: 0.4; margin-right: 8px; flex-shrink: 0; }
    }

    & input, & textarea {
      background: var(--acid-3); border: 1px solid var(--acid-10); color: var(--acid); font-family: var(--font-mono); font-size: 13px; padding: 6px 10px; flex: 1; outline: none;

      &:focus { border-color: var(--acid-30); }
    }

    & textarea { min-height: 60px; resize: vertical; }

    & button {
      background: transparent; border: 1px solid var(--acid); color: var(--acid); font-family: var(--font-mono); font-size: 13px; padding: 6px 20px; cursor: pointer; margin-top: var(--sp-3); transition: all var(--ease-fast);

      &:hover { background: var(--acid); color: var(--void); }
    }

    & .xmit-hint {
      font-size: 10px; color: var(--acid-20); margin-top: var(--sp-1);
      letter-spacing: 1px; transition: opacity 0.3s;
      animation: hintPulse 2.5s ease-in-out infinite;
    }
  }

  @keyframes hintPulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.6; }
  }

  /* ===== TRANSMISSION PROTOCOL ===== */

  .xmit-gauge {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px;
    color: var(--acid); opacity: 0; height: 1.4em;
    margin-bottom: var(--sp-2); transition: opacity 0.3s;
    white-space: nowrap; overflow: hidden;
  }

  .xmit-gauge.xmit-err { color: var(--blood); }

  .xmit-log {
    display: none; font-family: var(--font-mono); font-size: 11px;
    color: var(--acid-40); max-height: 10em; overflow-y: auto;
    margin-top: var(--sp-3); border-top: 1px solid var(--acid-10);
    padding-top: var(--sp-2);
  }

  .xmit-log-line {
    animation: xmitLineIn 0.18s ease-out both;
    white-space: nowrap; overflow: hidden; line-height: 1.6;
  }

  .xmit-log-final { color: var(--acid); font-weight: 700; }
  .xmit-log-line.xmit-log-err { color: var(--blood); }

  @keyframes xmitLineIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  /* charging state */
  .terminal-form.xmit-pressurizing {
    border-color: var(--acid-30);
  }

  .terminal-form .xmit-btn-charging {
    background: var(--acid) !important; color: var(--void) !important;
    user-select: none; -webkit-user-select: none;
  }

  /* firing state */
  .terminal-form.xmit-firing {
    border-color: var(--acid);
  }

  .terminal-form.xmit-firing input,
  .terminal-form.xmit-firing textarea {
    color: var(--acid-40);
  }

  /* done state */
  .terminal-form.xmit-done button {
    background: var(--acid); color: var(--void);
    pointer-events: none;
  }

  /* flash overlay */
  .xmit-flash {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--acid); opacity: 0; pointer-events: none;
    mix-blend-mode: screen;
  }

  .xmit-flash-go {
    animation: xmitFlash 0.35s ease-out forwards;
  }

  @keyframes xmitFlash {
    0%   { opacity: 0.6; }
    100% { opacity: 0; }
  }

  /* shake on reject */
  @keyframes xmitShake {
    0%, 100% { transform: translateX(0); }
    15%  { transform: translateX(-6px); }
    30%  { transform: translateX(5px); }
    45%  { transform: translateX(-4px); }
    60%  { transform: translateX(3px); }
    75%  { transform: translateX(-2px); }
  }

  .xmit-shake { animation: xmitShake 0.4s ease-out; }

  /* ===== KRAKAN REVEAL ===== */
  .kraken-reveal {
    text-align: center; margin-top: var(--sp-9);

    & pre { display: inline-block; font-family: var(--font-mono); font-size: clamp(4px, 0.7vw, 7px); line-height: 1.0; letter-spacing: 0; color: var(--acid); white-space: pre; opacity: 0.25; text-shadow: var(--glow-sm); }
  }
}
