:root {
    --green: #00ff88;
    --green-dim: #00cc66;
    --green-dark: #003322;
    --bg: #0a0f0a;
    --text: #c8ffd4;
    --comment: #4a9a6a;
    --keyword: #ff7eb3;
    --string: #ffd580;
    --number: #82aaff;
    --dim: #1a2a1a;
  }

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

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
  }

  /* ── LANDING ── */
  #landing {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--bg);
    z-index: 100;
    transition: opacity 0.8s ease;
  }
  #landing .title {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--comment);
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
  }
  #landing .title span { color: var(--green); }
  #start-btn {
    width: 160px; height: 160px;
    border-radius: 50%;
    border: 3px solid var(--green);
    background: transparent;
    color: var(--green);
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0,255,136,0.2), inset 0 0 30px rgba(0,255,136,0.05);
  }
  #start-btn::before {
    content: '';
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(0,255,136,0.3);
    animation: pulse-ring 2s ease-out infinite;
  }
  #start-btn::after {
    content: '';
    position: absolute; inset: -16px;
    border-radius: 50%;
    border: 1px solid rgba(0,255,136,0.15);
    animation: pulse-ring 2s ease-out infinite 0.4s;
  }
  #start-btn:hover {
    background: rgba(0,255,136,0.08);
    box-shadow: 0 0 60px rgba(0,255,136,0.4), inset 0 0 40px rgba(0,255,136,0.1);
    transform: scale(1.05);
  }
  @keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 0; }
  }

  /* ── CODE BACKGROUND ── */
  #code-bg {
    position: fixed; inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
  }
  #code-bg.visible { opacity: 1; }
  .code-rain {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-wrap: wrap;
    align-content: flex-start;
    padding: 1rem;
    font-size: 0.72rem;
    line-height: 1.7;
    color: rgba(0,255,136,0.07);
    pointer-events: none;
    user-select: none;
    overflow: hidden;
  }

  /* ── TYPEWRITER SCENE ── */
  #typewriter-scene {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center;
    padding: clamp(2rem, 6vw, 6rem);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
  }
  #typewriter-scene.visible { opacity: 1; pointer-events: all; }

  .tw-line {
    font-size: clamp(0.85rem, 2.5vw, 1.15rem);
    line-height: 2;
    max-width: 780px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .tw-line.shown { opacity: 1; transform: none; }
  .tw-line .kw   { color: var(--keyword); }
  .tw-line .str  { color: var(--string); }
  .tw-line .num  { color: var(--number); }
  .tw-line .cm   { color: var(--comment); font-style: italic; }
  .tw-line .fn   { color: #c792ea; }
  .tw-line .op   { color: var(--green); }
  .cursor {
    display: inline-block;
    width: 2px; height: 1.1em;
    background: var(--green);
    vertical-align: middle;
    margin-left: 3px;
    animation: blink 1s step-end infinite;
  }
  @keyframes blink { 50% { opacity: 0; } }

  /* ── HIDDEN BUTTON ── */
  #hidden-btn {
    position: fixed;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.4);
    color: var(--green);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease, box-shadow 0.3s ease;
    z-index: 20;
    white-space: nowrap;
    letter-spacing: 0.1em;
  }
  #hidden-btn.visible { opacity: 1; }
  #hidden-btn:hover {
    box-shadow: 0 0 16px rgba(0,255,136,0.5);
    background: rgba(0,255,136,0.15);
  }

  /* ── SECTION LABEL ── */
  #section-label {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    padding: 2rem;
    text-align: center;
  }
  #section-label.visible { opacity: 1; }
  #section-label .sec-tag {
    font-size: 0.8rem;
    color: var(--comment);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
  }
  #section-label .sec-title {
    font-size: clamp(1.6rem, 5vw, 3rem);
    color: var(--green);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(0,255,136,0.4);
  }
  #section-label .sec-desc {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text);
    max-width: 600px;
    line-height: 1.9;
    opacity: 0.8;
  }

  /* ── PHOTO VIEWER ── */
  #photo-viewer {
    position: fixed; inset: 0;
    background: #000;
    z-index: 12;
    display: flex;
    align-items: center; justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  #photo-viewer.visible { opacity: 1; pointer-events: all; }
  #photo-viewer img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 80px rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.6s ease;
  }
  #photo-viewer img.shown { opacity: 1; }
  #photo-counter {
    position: absolute;
    bottom: 2rem; right: 2rem;
    font-size: 0.75rem;
    color: rgba(0,255,136,0.5);
    letter-spacing: 0.15em;
  }
  #photo-section-name {
    position: absolute;
    top: 2rem; left: 2rem;
    font-size: 0.75rem;
    color: rgba(0,255,136,0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }
  .photo-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    width: 0%;
    transition: width linear;
  }

  /* ── BLACK BREAK ── */
  #black-break {
    position: fixed; inset: 0;
    background: #000;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  #black-break.visible { opacity: 1; }

  /* ── FINALE ── */
  #finale {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    padding: 3rem;
    text-align: center;
  }
  #finale.visible { opacity: 1; }
  #finale .fin-pre {
    font-size: 0.75rem;
    color: var(--comment);
    letter-spacing: 0.3em;
    margin-bottom: 2rem;
  }
  #finale .fin-main {
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    color: var(--green);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 2rem;
    text-shadow: 0 0 40px rgba(0,255,136,0.3);
    max-width: 750px;
  }
  #finale .fin-sub {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    color: var(--text);
    opacity: 0.7;
    line-height: 2;
    max-width: 580px;
    margin-bottom: 3rem;
  }
  #finale .fin-heart {
    font-size: 2rem;
    animation: heartbeat 1.4s ease-in-out infinite;
  }
  @keyframes heartbeat {
    0%,100% { transform: scale(1); }
    14%      { transform: scale(1.2); }
    28%      { transform: scale(1); }
    42%      { transform: scale(1.15); }
  }
  #finale .fin-sig {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--comment);
    letter-spacing: 0.15em;
  }
  #finale .fin-sig span { color: var(--keyword); }