/* ==========================================================================
   DESIGN SYSTEM
   black · deep navy · off-white · muted red · a little blue light
   serif for feeling · sans for interface · mono for dates and metadata
   ========================================================================== */
:root {
  --ink: #050608;
  --night: #090c13;
  --navy: #0e1524;
  --navy-2: #16203a;
  --paper: #ece6da;
  --paper-2: #d8d0c1;
  --paper-dim: #a9a397;
  --mute: #6f727b;
  --line: rgba(236, 230, 218, 0.12);
  --line-2: rgba(236, 230, 218, 0.22);
  --red: #a8322d;
  --red-soft: #c65a51;
  --blue: #6ea8ff;
  --warm: #e8b16a;
  --up: #3fb68b;
  --dn: #e0605a;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --ease-cine: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); color: var(--paper); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 400; }

/* ------------------------------------------------------------- scenes */
.scene { position: fixed; inset: 0; visibility: hidden; opacity: 0; transition: opacity 1.2s var(--ease-cine), visibility 0s 1.2s; }
.scene.is-on { visibility: visible; opacity: 1; transition: opacity 1.2s var(--ease-cine); }

/* ------------------------------------------------------- atmosphere */
#dust { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
body.ch-open #dust, body.ch-open .grain, body.pk-open .grain, body.cz-open .grain { display: none; }
.gift-open #dust { opacity: 0; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.grain {
  position: fixed; inset: -100px; pointer-events: none; z-index: 90; opacity: 0.075;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-40px, 24px); } 40% { transform: translate(28px, -36px); }
  60% { transform: translate(-18px, -12px); } 80% { transform: translate(36px, 30px); } 100% { transform: translate(0, 0); }
}
#fade { position: fixed; inset: 0; background: #000; opacity: 1; pointer-events: none; z-index: 95; transition: opacity 1.4s var(--ease-cine); }
body.is-ready #fade { opacity: 0; }

/* ------------------------------------------------------------ cursor */
.has-cursor, .has-cursor * { cursor: none !important; }
#cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; mix-blend-mode: difference; }
#cursor i, #cursor b { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
#cursor i { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #fff; }
#cursor b { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid rgba(255, 255, 255, 0.4); transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), margin 0.4s var(--ease-out), border-color 0.4s, opacity 0.4s; }
#cursor.is-hover b { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-color: rgba(255, 255, 255, 0.75); }
#cursor.is-down b { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
#cursor.is-away { opacity: 0; }
body:not(.has-cursor) #cursor { display: none; }

/* ------------------------------------------------------------- photo */
.ph { position: relative; overflow: hidden; background: #111318; width: 100%; }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.ph.is-full img:not(.ph-bg) { position: relative; z-index: 1; object-fit: contain; }
.ph.is-full .ph-bg { position: absolute; inset: -8%; width: 116%; height: 116%; filter: blur(18px) brightness(0.55); }
.ph.is-loaded img { opacity: 1; }
.ph.is-empty {
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(236, 230, 218, 0.07), transparent 60%),
    linear-gradient(160deg, #1a1d24 0%, #0d0f14 100%);
}
.ph.is-empty::after {
  content: ""; position: absolute; inset: 0; opacity: 0.35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.ph-crop { position: absolute; width: 12px; height: 12px; border-color: rgba(236, 230, 218, 0.28); border-style: solid; border-width: 0; }
.ph-crop--tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.ph-crop--tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.ph-crop--bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.ph-crop--br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }
.ph-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(236, 230, 218, 0.38); font-size: 9.5px; white-space: nowrap; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#hud > * { pointer-events: auto; }

#hud-chapter {
  position: absolute; left: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; color: var(--paper-dim);
  opacity: 0; transform: translateY(6px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
#hud-chapter.is-on { opacity: 1; transform: none; }
.hc-act { color: var(--paper); }
.hc-bar { position: relative; width: 90px; height: 1px; background: var(--line-2); overflow: hidden; }
.hc-bar i { position: absolute; inset: 0; background: var(--paper); transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease-cine); }
.hc-year { color: var(--paper); }

#hud-back {
  position: absolute; left: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom));
  padding: 8px 12px; color: var(--paper); background: rgba(8, 8, 14, 0.55); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 0.3s, color 0.3s;
}
#hud-back:hover { background: var(--paper); color: #0b0b10; }
.gift-open #hud-back { display: none; }
body[data-scene="timeline"] #hud-back { left: auto; right: calc(var(--gutter) + 110px); }
#hud-sound {
  position: absolute; right: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom));
  color: var(--paper-dim); padding: 6px 0; transition: color 0.3s;
}
#hud-sound:hover { color: var(--paper); }
#hud-sound span { color: var(--paper); }


@media (max-width: 759px) {
  body[data-scene="timeline"] #hud-back { right: 16px; bottom: calc(52px + env(safe-area-inset-bottom)); }
  .gift-open #hud-back {
  position: absolute; left: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom));
  padding: 8px 12px; color: var(--paper); background: rgba(8, 8, 14, 0.55); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 0.3s, color 0.3s;
}
#hud-back:hover { background: var(--paper); color: #0b0b10; }
.gift-open #hud-back { display: none; }
body[data-scene="timeline"] #hud-back { left: auto; right: calc(var(--gutter) + 110px); }
#hud-sound { display: none; }
  #hud-back {
  position: absolute; left: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom));
  padding: 8px 12px; color: var(--paper); background: rgba(8, 8, 14, 0.55); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 0.3s, color 0.3s;
}
#hud-back:hover { background: var(--paper); color: #0b0b10; }
.gift-open #hud-back { display: none; }
body[data-scene="timeline"] #hud-back { left: auto; right: calc(var(--gutter) + 110px); }
#hud-sound { bottom: calc(18px + env(safe-area-inset-bottom)); }
  #hud-chapter { bottom: calc(18px + env(safe-area-inset-bottom)); gap: 10px; }
  #hud-chapter .hc-act { display: none; }
  .hc-bar { width: 48px; }
}

/* ------------------------------------------------------- title card */
#titlecard {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center; gap: 18px;
  background: #030406; opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease-cine), visibility 0s 0.6s;
}
#titlecard.is-on { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease-cine); }
#titlecard.is-out { opacity: 0; }
.tc-title { font-family: var(--sans); font-weight: 500; font-size: clamp(22px, 4.2vw, 54px); letter-spacing: 0.42em; padding-left: 0.42em; }
.tc-title span { display: inline-block; opacity: 0; filter: blur(8px); animation: tcIn 1s var(--ease-out) forwards; }
.tc-sub { font-style: italic; font-size: clamp(16px, 1.6vw, 20px); color: var(--paper-dim); opacity: 0; animation: fadeUp 1s 0.5s var(--ease-out) forwards; }
@keyframes tcIn { to { opacity: 1; filter: blur(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; top: calc(26px + env(safe-area-inset-top)); z-index: 80; transform: translate(-50%, -10px);
  font-style: italic; font-size: 17px; color: var(--paper); padding: 10px 18px; border: 1px solid var(--line-2);
  background: rgba(5, 6, 8, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); max-width: calc(100vw - 32px); text-align: center;
}
#toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------ light slit */
#slit { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: none; }
#slit.is-line, #slit.is-open { display: block; }
#slit .sl-l, #slit .sl-r { position: absolute; top: 0; bottom: 0; width: 50.2%; background: #020203; transition: transform 1.4s var(--ease-cine); }
#slit .sl-l { left: 0; } #slit .sl-r { right: 0; }
#slit .sl-beam {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, #f6e3c2 20%, #fff 50%, #f6e3c2 80%, transparent);
  box-shadow: 0 0 30px 6px rgba(246, 227, 194, 0.5), 0 0 120px 30px rgba(246, 227, 194, 0.18);
  transform: scaleY(0); transition: transform 1s var(--ease-cine), opacity 1.2s, width 1.4s var(--ease-cine), margin 1.4s var(--ease-cine);
}
#slit.is-line .sl-beam { transform: scaleY(1); }
#slit.is-open .sl-beam { transform: scaleY(1); opacity: 0; width: 60vw; margin-left: -30vw; }
#slit.is-open .sl-l { transform: translateX(-100%); }
#slit.is-open .sl-r { transform: translateX(100%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.2s !important; }
  .grain { animation: none; }
}

/* ==========================================================================
   THE DESKTOP — first screen: one folder called georgie (js/desktop.js)
   ========================================================================== */
.dt { position: fixed; inset: 0; z-index: 96; background: #000; color: #f5f5f7; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--sans);
  opacity: 0; transition: opacity 0.6s ease; cursor: default; }
.dt.is-on { opacity: 1; }
.dt.is-out { opacity: 0; transition: opacity 0.9s var(--ease-cine); pointer-events: none; }
.dt-bar { position: absolute; left: 0; right: 0; top: 0; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 13.5px;
  background: rgba(30, 30, 32, 0.55); }
.dt-bar-l, .dt-bar-r { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.dt-logo { width: 15px; height: 15px; display: grid; color: #fff; }
.dt-logo svg { width: 100%; height: 100%; }
.dt-bar-l b { font-weight: 700; }
.dt-menu { opacity: 0.92; }
.dt-sys { width: 22px; height: 14px; display: grid; place-items: center; }
.dt-sys svg { width: 100%; height: 100%; }
.dt-clock { font-variant-numeric: tabular-nums; white-space: pre; }
.dt-folder { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); display: grid; justify-items: center; gap: 6px; padding: 0; background: none; border: 0; color: inherit; cursor: default; outline: none;
  animation: dtIn 0.9s 0.3s var(--ease-out) both; }
@keyframes dtIn { from { opacity: 0; transform: translate(-50%, -48%) scale(0.92); } }
.dt-icon { width: 132px; height: 112px; display: grid; place-items: center; border-radius: 9px; border: 2px solid transparent; padding: 6px; transition: background 0.12s, border-color 0.12s; }
.dt-icon svg { width: 116px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.dt-name { padding: 2px 8px; border-radius: 5px; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.dt-folder.is-sel .dt-icon { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
.dt-folder.is-sel .dt-name { background: #e5437a; text-shadow: none; }
.dt-hint { position: absolute; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; font-size: 12.5px; color: rgba(245, 245, 247, 0.45); animation: dtHint 1s 1.6s both; }
@keyframes dtHint { from { opacity: 0; } }
.dt.is-opening .dt-hint, .dt.is-opening .dt-folder { opacity: 0; transition: opacity 0.3s; }
/* the folder opening into a window */
.dt-zoom { position: fixed; z-index: 2; border-radius: 12px; background: #0b0d12; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 120px rgba(0, 0, 0, 0.8);
  transition: left 0.75s var(--ease-cine), top 0.75s var(--ease-cine), width 0.75s var(--ease-cine), height 0.75s var(--ease-cine), border-radius 0.75s var(--ease-cine); overflow: hidden; }
.dt-zoom.is-open { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; }

/* the calendar widget, top left */
.dt .dc { position: absolute; left: 20px; top: 44px; width: 184px; padding: 13px 11px 10px; border-radius: 20px; background: #fff; color: #1c1c1e;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); animation: dcIn 0.8s 0.2s var(--ease-out) both; }
@keyframes dcIn { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
.dc-head { margin: 0 0 5px 3px; }
.dc-m { color: #ff3b30; font-weight: 700; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.dc-w, .dc-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dc-w span { font-size: 8.5px; font-weight: 700; color: #8e8e93; padding-bottom: 3px; }
.dc-d { position: relative; display: grid; place-items: center; height: 19px; font-size: 10px; font-weight: 600; }
.dc-d.is-we { color: #8e8e93; }
.dc-d b { position: relative; z-index: 1; font-weight: inherit; transition: color 0.35s 0.35s; }
.dc-d.is-today b { color: #ff3b30; }
.dc-d.is-day::before { content: ""; position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; border-radius: 50%; background: #ff3b30; transform: scale(0); transition: transform 0.5s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.dc-ring { position: absolute; left: 50%; top: 50%; width: 25px; height: 25px; margin: -12.5px 0 0 -12.5px; display: block; }
.dc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.dc-ring circle { fill: none; stroke: #ff3b30; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.7s var(--ease-out); }
.dc.is-mark .dc-ring circle { stroke-dashoffset: 0; }
.dc.is-mark .dc-d.is-day::before { transform: scale(1); }
.dc.is-mark .dc-d.is-day b { color: #fff; }
.dc.is-mark .dc-d.is-day { animation: dcBeat 1.8s 1.2s ease-in-out infinite; }
@keyframes dcBeat { 50% { transform: scale(1.12); } }
.dc-note { display: block; margin: 6px 3px 0; font-size: 10px; font-weight: 600; color: #ff3b30; }
.dt.is-opening .dc { opacity: 0; transition: opacity 0.3s; }
@media (max-width: 640px) {
  .dt .dc { left: 12px; top: 40px; width: 140px; padding: 10px 8px 8px; border-radius: 16px; }
  .dc-m { font-size: 9px; }
  .dc-w span { font-size: 7px; }
  .dc-d { height: 15px; font-size: 8px; }
  .dc-d.is-day::before { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
  .dc-ring { width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; }
  .dt-menu { display: none; }
  .dt-bar { font-size: 12.5px; }
  .dt-bar-r { gap: 10px; }
}
