/* ============================================================
   WINTERBESEN — style.css
   a small frozen world. cold, dreamy, minimal.
   no build step. upload the folder and it lives.
   ============================================================ */

/* ---- tokens ------------------------------------------------- */

:root {
  --void:      #0a0c14;
  --void-2:    #05070f;
  --deep:      #0e1526;
  --ink:       #dfe9f4;
  --ink-dim:   rgba(219, 232, 245, 0.55);
  --ink-faint: rgba(219, 232, 245, 0.32);
  --ice:       #bfe1ff;
  --ice-2:     #8fc7ff;
  --moon:      #eef6ff;
  --glass:     linear-gradient(135deg, rgba(150,190,235,0.09), rgba(190,215,245,0.03));
  --glass-brd: rgba(170,205,240,0.16);
  --glass-brd-hi: rgba(185,220,255,0.34);

  --font-serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-mono:  "Space Grotesk", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
  --ease-soft: cubic-bezier(0.3, 0.7, 0.3, 1);
  --dur: 1100ms;
}

@media (prefers-color-scheme: light) {
  :root { /* we stay cold. daylight does not reach here. */ }
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- reset -------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
input { font: inherit; color: inherit; }
::selection { background: rgba(180,220,255,0.25); }

.mono { font-family: var(--font-mono); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

body:has(.overlay.open) { overflow: hidden; }

/* ---- atmosphere --------------------------------------------- */

.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden;
       background:
         radial-gradient(120% 90% at 70% 110%, #0b1426 0%, transparent 55%),
         radial-gradient(90% 80% at 20% -10%, #0c1830 0%, transparent 60%),
         var(--void-2);
}

.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: drift 36s var(--ease-soft) infinite alternate;
  will-change: transform;
}
.aurora--a {
  width: 60vw; height: 60vw; top: 40%; left: -15%;
  background: radial-gradient(circle, rgba(60,110,180,0.55) 0%, rgba(60,110,180,0) 65%);
  animation-duration: 42s;
}
.aurora--b {
  width: 50vw; height: 50vw; top: 12%; left: 42%;
  background: radial-gradient(circle, rgba(90,135,215,0.4) 0%, rgba(90,135,215,0) 62%);
  animation-duration: 52s;
  animation-delay: -14s;
}
.aurora--c {
  width: 42vw; height: 42vw; bottom: 4%; right: -8%;
  background: radial-gradient(circle, rgba(50,95,170,0.35) 0%, rgba(50,95,170,0) 64%);
  animation-duration: 48s;
  animation-delay: -28s;
}
@keyframes drift {
  0%   { opacity: 0.55; transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { opacity: 0.9;  transform: translate3d(4vw, -3vh, 0) rotate(8deg); }
  100% { opacity: 0.5;  transform: translate3d(-3vw, 2vh, 0) rotate(-6deg); }
}

/* the snowflake — floats near the top, slowly turning */
.flake-holder {
  position: absolute;
  top: clamp(12vh, 18vh, 22vh);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(70px, 12vh, 130px);
  height: clamp(70px, 12vh, 130px);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.flake {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(219, 233, 245, 0.18));
  animation: flaketurn 40s linear infinite;
  opacity: 0.94;
}
@keyframes flaketurn {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- water / particles canvas ------------------------------- */
#fx {
  position: fixed; inset: 0;
  z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none; /* the water refracts, but never blocks */
}

/* ---- grain --------------------------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("assets/grain.svg");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  animation: grain 1.4s steps(4) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1.5%); }
  50%  { transform: translate(1.5%, -1%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---- scene frame ---------------------------------------------- */
.scene {
  position: fixed; inset: 0; z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto 0px;
  pointer-events: none;
  padding: max(20px, env(safe-area-inset-top)) 24px
           max(20px, env(safe-area-inset-bottom));
}
.scene > * { pointer-events: auto; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 80;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(10,14,26,0.8); color: var(--ink);
  border: 1px solid var(--glass-brd); text-decoration: none; font-size: 13px;
  transform: translateY(-140%);
  transition: transform 300ms var(--ease);
}
.skip:focus-visible { transform: translateY(0); }

/* ---- wordmark ------------------------------------------------ */
.title { align-self: start; justify-self: center; text-align: center;
         margin-top: clamp(20vh, 24vh, 30vh);
         user-select: none;
         -webkit-user-select: none; }

.wordmark {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 10vw + 1rem, 9rem);
  font-style: italic;
  line-height: 0.95;
  letter-spacing: 0.06em;
  background: linear-gradient(120deg,
    rgba(230,240,252,0.92) 10%,
    rgba(168,201,236,0.8) 45%,
    rgba(210,232,255,0.5) 65%,
    rgba(235,245,255,0.92) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 22px rgba(140,180,235,0.28));
}
.wordmark span {
  display: inline-block;
  animation: letterfloat 7s var(--ease-soft) infinite alternate;
  animation-delay: calc(var(--i) * -0.55s);
  will-change: transform, opacity;
}
@keyframes letterfloat {
  from { transform: translateY(0) rotate(0deg); opacity: 0.92; }
  to   { transform: translateY(-6px) rotate(1.4deg); opacity: 1; }
}

.subtitle {
  margin: 1.1em 0 0;
  font-size: clamp(0.72rem, 0.6vw + 0.55rem, 0.95rem);
  font-weight: 300;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.secretline {
  margin: 1.2em 0 0;
  min-height: 1.3em;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 0.5vw + 0.7rem, 1.15rem);
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.secretline.on  { opacity: 1; }

/* ---- glass widgets ------------------------------------------- */
.widgets {
  align-self: end;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 20px);
  max-width: 1080px;
  margin-bottom: clamp(18px, 7vh, 72px);
}

.wobble { animation: wobble 14s ease-in-out infinite; }
.wobble:nth-child(2) { animation-duration: 18s; animation-delay: -3s; }
.wobble:nth-child(3) { animation-duration: 15s; animation-delay: -7s; }
.wobble:nth-child(4) { animation-duration: 19s; animation-delay: -2s; }
.wobble:nth-child(5) { animation-duration: 16s; animation-delay: -9s; }
.wobble:nth-child(6) { animation-duration: 21s; animation-delay: -5s; }

@keyframes wobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-5px) rotate(-0.4deg); }
  66%      { transform: translateY(2px) rotate(0.5deg); }
}

.widget {
  position: relative;
  width: clamp(148px, 18vw, 208px);
  min-height: 128px;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 20px 48px -18px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.08),
              0 0 0 0px rgba(160, 205, 255, 0);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 700ms var(--ease), box-shadow 700ms var(--ease),
              border-color 700ms var(--ease), background 700ms var(--ease);
  transform: translate3d(0, 0, 0);
  outline: 1px solid transparent;
  outline-offset: 3px;
  text-align: left;
  color: inherit;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.widget::before { /* cold sheen that slides */
  content: "";
  position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(115deg, rgba(255,255,255,0.07), transparent 40%);
  opacity: 0.5;
  transition: opacity 700ms var(--ease);
  pointer-events: none;
}

.widget:hover, .widget:focus-visible, .widget:has(input:focus) {
  transform: translate3d(0, -6px, 0) scale(1.012);
  border-color: var(--glass-brd-hi);
  background: linear-gradient(135deg, rgba(165,205,248,0.15), rgba(195,222,252,0.05));
  box-shadow: 0 26px 60px -16px rgba(0, 0, 0, 0.7),
              0 0 34px -4px rgba(150, 200, 255, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.widget:active { transform: translate3d(0, -2px, 0) scale(0.99); }
.widget:hover::before { opacity: 0.85; }
.widget:focus-visible { outline: 2px solid var(--glass-brd-hi); }

.widget-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.widget-hint {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.widget-quote {
  margin-top: auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.06rem;
  color: var(--ink);
}
.glyph-ico { color: var(--ice-2); opacity: 0.85; margin-top: 4px; }

.clock-big {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bars { display: flex; gap: 4px; align-items: center; margin: 2px 0; }
.bars i {
  width: 5px; height: 8px; border-radius: 2px;
  background: linear-gradient(to top, var(--ice-2), var(--ice));
  opacity: 0.28;
  animation: bar 2.4s ease-in-out infinite;
}
.bars i:nth-child(2) { animation-delay: 0.18s; height: 12px; }
.bars i:nth-child(3) { animation-delay: 0.36s; height: 16px; }
.bars i:nth-child(4) { animation-delay: 0.54s; height: 20px; }
.bars i:nth-child(5) { animation-delay: 0.72s; height: 24px; }
.bars--big i { width: 7px; height: 14px; opacity: 0.5; }
.bars--big i:nth-child(2) { height: 20px; }
.bars--big i:nth-child(3) { height: 26px; }
.bars--big i:nth-child(4) { height: 32px; }
.bars--big i:nth-child(5) { height: 38px; }
.bars--big i:nth-child(6) { height: 44px; }
.bars--big i:nth-child(7) { height: 50px; }
@keyframes bar {
  0%, 100% { opacity: 0.22; transform: scaleY(0.7); }
  50%      { opacity: 0.95; transform: scaleY(1.08); }
}

.weather-temp {
  font-family: var(--font-mono);
  font-size: 1.7rem; font-weight: 200;
  letter-spacing: 0.02em; color: var(--ink);
}

/* ---- toast ---------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 40;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(12, 18, 34, 0.82);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 0.78rem; letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  pointer-events: none;
  max-width: min(86vw, 480px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- footer backlink ---------------------------------------- */
.foot {
  position: fixed;
  left: 0; right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 30;
  text-align: center;
  pointer-events: none;
}
.foot a {
  display: inline-block;
  pointer-events: auto;
  padding: 5px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: none;
  color: rgba(219, 232, 245, 0.46);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 400ms var(--ease), border-color 400ms var(--ease);
}
.foot a:hover, .foot a:focus-visible {
  color: var(--ink);
  border-color: var(--glass-brd);
}
.foot a:focus-visible { outline: 2px solid var(--glass-brd-hi); outline-offset: 2px; }

/* ---- overlays -------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 12, 0.42);
  backdrop-filter: blur(8px) saturate(0.9);
  -webkit-backdrop-filter: blur(8px) saturate(0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease), visibility 0s linear 600ms;
  pointer-events: none;
}
.overlay.open {
  opacity: 1; visibility: visible;
  transition: opacity 600ms var(--ease);
  pointer-events: auto;
}
.overlay.open .panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.panel {
  width: min(540px, 94vw);
  max-height: 84vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 34px 30px;
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(150,185,235,0.12), rgba(20,30,55,0.32) 55%, rgba(10,16,30,0.4));
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.75),
              0 0 60px -10px rgba(140, 190, 255, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition: transform 700ms var(--ease), opacity 500ms var(--ease);
  animation: panelin 4s var(--ease-soft) infinite alternate;
}
@keyframes panelin {
  from { box-shadow: 0 40px 90px -20px rgba(0,0,0,0.75), 0 0 60px -10px rgba(140,190,255,0.22), inset 0 1px 0 rgba(255,255,255,0.1); }
  to   { box-shadow: 0 46px 100px -18px rgba(0,0,0,0.8), 0 0 90px -10px rgba(160,205,255,0.32), inset 0 1px 0 rgba(255,255,255,0.12); }
}

.panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.7rem, 2.2vw + 0.8rem, 2.4rem);
  letter-spacing: 0.02em;
}
.panel .close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,0.04);
  color: var(--ink-dim); font-size: 1.15rem; line-height: 1;
  cursor: pointer;
  transition: background 300ms, color 300ms, transform 300ms;
  appearance: none;
}
.panel .close:hover, .panel .close:focus-visible {
  background: rgba(255,255,255,0.1); color: var(--ink);
  transform: rotate(90deg);
}
.panel .close:focus-visible { outline: 2px solid var(--glass-brd-hi); outline-offset: 2px; }

.ov-sub { margin: 0 0 18px; font-weight: 300; color: var(--ink-dim); }
.ov-body { margin: 0 0 14px; font-weight: 300; color: var(--ink); }
.ov-body.dim, .ov-meta.dim { color: var(--ink-faint); font-size: 0.8rem; }
.ov-dial {
  margin: 8px 0 4px;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 200; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.ov-temp {
  margin: 4px 0 8px;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 150; letter-spacing: 0.01em; color: var(--ink);
}
.ov-phrase {
  margin: 4px 0 16px;
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--ice);
  text-shadow: 0 0 24px rgba(150,195,255,0.35);
}
.ov-meta { margin: 18px 0 0; font-size: 0.8rem; color: var(--ink-dim); }
.ov-meta b { font-weight: 500; color: var(--ink); }

.ov-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ov-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(170,205,240,0.1);
  font-size: 0.85rem; color: var(--ink-dim); font-weight: 300;
  letter-spacing: 0.06em; text-transform: lowercase;
}
.ov-list b { font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; }

/* traces / guestbook */
.traces { list-style: none; margin: 4px 0 20px; padding: 0;
          max-height: 26vh; overflow-y: auto; }
.traces li {
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(170,205,240,0.12);
  font-weight: 300; font-size: 0.9rem; color: var(--ink-dim);
}
.traces li b { color: var(--ice); font-weight: 500; margin-right: 10px; }
.traces .empty { color: var(--ink-faint); font-style: italic; font-family: var(--font-serif); font-size: 1rem; }

.trace-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; }
.field {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  background: rgba(8, 12, 24, 0.55);
  color: var(--ink);
  outline: none;
  transition: border-color 300ms, box-shadow 300ms;
  min-width: 0;
}
.field::placeholder { color: var(--ink-faint); font-weight: 300; }
.field:focus { border-color: var(--glass-brd-hi); box-shadow: 0 0 0 3px rgba(160,205,255,0.12); }

.pill {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-brd-hi);
  background: rgba(150, 195, 250, 0.1);
  color: var(--ice);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 400ms, box-shadow 400ms, transform 400ms;
  white-space: nowrap;
}
.pill:hover, .pill:focus-visible { background: rgba(160,205,255,0.2); box-shadow: 0 0 22px -4px rgba(150,200,255,0.45); }
.pill:active { transform: scale(0.97); }
.pill[aria-pressed="true"] { background: rgba(160,205,255,0.24); }
.pill:focus-visible { outline: 2px solid var(--glass-brd-hi); outline-offset: 2px; }

/* ---- keyboard focus on wordmark et al -------------------------- */
.title:focus-visible { outline: none; }

/* ---- reduced motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
  .subtitle, .secretline, .wordmark, .panel { opacity: 1; }
  .wordmark span { animation: none; }
  .toast { transition: opacity 1ms; }
  .overlay .panel { transform: none; }
}

/* ---- small screens --------------------------------------------- */
@media (max-width: 720px) {
  .scene { grid-template-rows: 1fr auto 0px; padding: 16px 14px; }
  .title { margin-top: clamp(26vh, 30vh, 36vh); }
  .wordmark { letter-spacing: 0.03em; }
  .subtitle { letter-spacing: 0.3em; }

  .widgets { gap: 10px; max-width: 100%; }
  .widget {
    width: calc(33vw - 12px);
    min-width: 0;
    min-height: 108px;
    padding: 14px 14px 12px;
  }
  .widget-label { letter-spacing: 0.22em; font-size: 0.6rem; }
  .clock-big { font-size: 1.25rem; }
  .weather-temp { font-size: 1.25rem; }
  .widget-hint { font-size: 0.62rem; letter-spacing: 0.04em; }

  .trace-form { grid-template-columns: 1fr; }
  .pill { width: 100%; }
  .flake { width: 72%; height: 72%; }
}

/* tiny phones */
@media (max-width: 400px) {
  .wordmark { font-size: 2.3rem; }
}

/* landscape short screens */
@media (max-height: 560px) and (orientation: landscape) {
  .title { margin-top: 18vh; }
  .wordmark { font-size: clamp(2.4rem, 7vw, 4rem); }
  .widgets { gap: 8px; }
  .widget { min-height: 96px; }
}

/* taller than wide: stack under the moon */
@media (orientation: portrait) {
  .title { margin-top: clamp(30vh, 36vh, 44vh); }
  .subtitle { letter-spacing: 0.26em; }
}