/* Svetlina website. One page, light and dark. The dark values are written twice:
   once for the system's dark mode (unless the visitor picked light) and once for a picked dark. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #1b1c1f;
  --ink-2: #575a61;
  --ink-3: #666a72;
  --hair: rgba(16, 22, 34, 0.15);
  --rim: rgba(16, 22, 34, 0.18);
  --rim-strong: rgba(16, 22, 34, 0.5);
  --cut: rgba(16, 22, 34, 0.45);
  --glow: 0;
  --stage: #f3f4f6;
  --stage-glow: 0;

  /* The app's own "Quiet Tool" tokens (packages/desktop/src/renderer/styles.css in the app repo). */
  --a-paper: #ffffff;
  --a-material: #e6e8ec;
  --a-ink: #1b1c1f;
  --a-ink2: #575a61;
  --a-ink3: #666a72;
  --a-ink4: #a3a6ad;
  --a-hair: rgba(16, 22, 34, 0.15);
  --a-hair2: rgba(16, 22, 34, 0.25);
  --a-fill2: rgba(16, 22, 34, 0.085);
  --a-accent: #2b5b9e;
  --a-accent-wash: rgba(43, 91, 158, 0.12);
  --a-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 30px 80px rgba(22, 28, 40, 0.28), 0 8px 24px rgba(22, 28, 40, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0b;
    --ink: #f5f5f3;
    --ink-2: #b3b5ba;
    --ink-3: #8e9095;
    --hair: rgba(255, 255, 255, 0.1);
    --rim: rgba(255, 255, 255, 0.22);
    --rim-strong: rgba(255, 255, 255, 0.6);
    --cut: rgba(0, 0, 0, 0.6);
    --glow: 0.13;
    --stage: #0a0a0b;
    --stage-glow: 1;
    --a-paper: #1c1d20;
    --a-material: #2a2b30;
    --a-ink: #e5e6e9;
    --a-ink2: #a9acb3;
    --a-ink3: #8c8f97;
    --a-ink4: #5d6067;
    --a-hair: rgba(255, 255, 255, 0.12);
    --a-hair2: rgba(255, 255, 255, 0.2);
    --a-fill2: rgba(255, 255, 255, 0.095);
    --a-accent: #8eb0e8;
    --a-accent-wash: rgba(142, 176, 232, 0.16);
    --a-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 40px 120px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --ink: #f5f5f3;
  --ink-2: #b3b5ba;
  --ink-3: #8e9095;
  --hair: rgba(255, 255, 255, 0.1);
  --rim: rgba(255, 255, 255, 0.22);
  --rim-strong: rgba(255, 255, 255, 0.6);
  --cut: rgba(0, 0, 0, 0.6);
  --glow: 0.13;
  --stage: #0a0a0b;
  --stage-glow: 1;
  --a-paper: #1c1d20;
  --a-material: #2a2b30;
  --a-ink: #e5e6e9;
  --a-ink2: #a9acb3;
  --a-ink3: #8c8f97;
  --a-ink4: #5d6067;
  --a-hair: rgba(255, 255, 255, 0.12);
  --a-hair2: rgba(255, 255, 255, 0.2);
  --a-fill2: rgba(255, 255, 255, 0.095);
  --a-accent: #8eb0e8;
  --a-accent-wash: rgba(142, 176, 232, 0.16);
  --a-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 40px 120px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.count {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--ink-3);
}

/* Slides: a surface with one opening into the photograph. */

.slide {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Let the soft glow fade out past the drawing's own edge; the slide still clips it.
     The photo is clipped to the opening, so nothing else can show at the edges. */
  overflow: visible;
}

.surface { fill: var(--bg); transition: fill 0.4s ease; }
.glow { fill: #ffffff; opacity: var(--glow); transition: opacity 0.5s ease; }
.rim { fill: none; stroke: var(--rim); stroke-width: 1; transition: stroke 0.3s ease; }
.cut { fill: none; stroke: var(--cut); }
.surface, .glow, .rim, .cut { pointer-events: none; }

/* The photo behind an opening fades in once it has loaded (main.js sets is-shown). */
.scene .photo { opacity: 0; transition: opacity 1.2s ease; }
.scene .photo.is-shown { opacity: 1; }

/* The first opening is a door: hovering or focusing it brightens the light and the edge. */
.enter { cursor: pointer; outline: none; }
.enter .hit { fill: transparent; }
.scene:has(.enter:hover) .glow, .scene:has(.enter:focus-visible) .glow { opacity: calc(var(--glow) * 1.9); }
.scene:has(.enter:hover) .rim, .scene:has(.enter:focus-visible) .rim { stroke: var(--rim-strong); }
.scene:has(.enter:focus-visible) .rim { stroke-width: 2; }
/* The text layer lies over the scene; let clicks through to the opening, except on its own controls. */
.slide-1 .wrap { pointer-events: none; }
.slide-1 .wrap a, .slide-1 .wrap button { pointer-events: auto; }

.wrap {
  position: relative;
  height: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.75rem 2rem 3rem;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.brand .mark { width: 28px; height: 28px; fill: var(--ink); transition: fill 0.4s ease; }
.brand span { font-weight: 500; font-size: 1.375rem; letter-spacing: -0.035em; }

.theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.theme-toggle:focus-visible, .brand:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-mode="dark"] .icon-sun { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }

.hero-line {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.hero-line p {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.slide-2 .wrap { justify-content: center; padding-top: 6rem; }
.statement {
  margin: 0;
  font-weight: 600;
  font-size: clamp(3.5rem, 10vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  max-width: 8ch;
}
.lede {
  margin: 2rem 0 0;
  font-weight: 300;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  max-width: 28rem;
  color: var(--ink-2);
}
.slide-2 .count { margin-top: 2.5rem; }

/* Slide 3: the app. */

.slide-3 {
  position: relative;
  background: var(--stage);
  transition: background-color 0.4s ease;
  overflow: hidden;
}
.slide-3::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 1200px;
  height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), transparent);
  opacity: var(--stage-glow);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.slide-3 .wrap { align-items: center; gap: 2.5rem; padding: 4.5rem 2rem 4rem; }

.intro { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.intro h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 34rem;
}

.soon { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; }
.soon strong { font-weight: 500; font-size: 1.25rem; letter-spacing: -0.02em; }

/* The app window, drawn at 1100 × 690 and scaled to fit (main.js sets --app-scale). */

.app-frame { position: relative; width: min(990px, 100%); aspect-ratio: 1100 / 690; }

.app {
  position: absolute;
  left: 0;
  top: 0;
  width: 1100px;
  height: 690px;
  transform-origin: 0 0;
  transform: scale(var(--app-scale, 0.9));
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--a-paper);
  color: var(--a-ink);
  box-shadow: var(--a-shadow);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.app-bar {
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 14px;
  background: var(--a-material);
  box-shadow: inset 0 -0.5px 0 var(--a-hair);
}
.app-bar .tl { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.app-bar .tl:nth-child(3) { margin-right: 18px; }
.app-bar .i { width: 16px; height: 16px; fill: none; stroke: var(--a-ink2); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.app-bar .i.off { stroke: var(--a-ink4); }
.app-bar .dock { margin-right: 8px; }
.app-bar .where { margin: 0 auto 0 8px; font-size: 13px; font-weight: 600; }
.app-bar .search {
  width: 236px;
  height: 26px;
  border-radius: 7px;
  background: var(--a-fill2);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--a-ink3);
}
.app-bar .search svg { width: 14px; height: 14px; fill: none; stroke: var(--a-ink3); stroke-width: 1.2; stroke-linecap: round; }
.app-bar .search span { flex: 1; }
.app-bar .search kbd { font: inherit; font-size: 11px; }
.app-bar .status { margin: 0 10px 0 14px; font-size: 12px; color: var(--a-ink3); }

.app-body { flex: 1; min-height: 0; display: flex; }

.app-dock {
  width: 232px;
  flex-shrink: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--a-ink2);
  background: var(--a-material);
  box-shadow: inset -0.5px 0 0 var(--a-hair);
}
.app-dock span { padding: 5px 8px; border-radius: 6px; }
.app-dock .on { background: var(--a-fill2); color: var(--a-ink); font-weight: 500; }
.app-dock .hd { padding: 14px 8px 4px; font-size: 11px; font-weight: 600; color: var(--a-ink3); }

.app-page { flex: 1; min-width: 0; overflow: hidden; background: var(--a-paper); }

.doc {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 40px 0;
  font-family: "Source Serif 4", Charter, Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
}
.day { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.date { font-weight: 600; font-size: 22px; line-height: 1.25; letter-spacing: -0.008em; }
.today {
  align-self: center;
  padding: 3px 7px;
  border-radius: 9px;
  background: var(--a-accent-wash);
  color: var(--a-accent);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.b { position: relative; padding-left: 20px; margin-bottom: 0.5em; }
.b::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--a-ink4);
}
.b.img { margin-bottom: 0.3em; }
.b .ph { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.b .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.kids { margin: -0.15em 0 0.5em 7px; padding-left: 13px; border-left: 0.5px solid var(--a-hair); }
.b.cap { display: flex; align-items: baseline; gap: 12px; margin-bottom: 0; }
.b.cap::before { top: 10px; background: transparent; box-shadow: inset 0 0 0 1px var(--a-ink4); }
.b.cap .txt { flex: 1; font-style: italic; font-size: 0.94em; color: var(--a-ink2); }
.used {
  flex-shrink: 0;
  height: 17px;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 0.5px var(--a-hair2);
  font: 600 10.5px/17px -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--a-ink3);
  text-align: center;
}
.tag { color: var(--a-ink3); }
.doc sup { font: 600 10px -apple-system, BlinkMacSystemFont, system-ui, sans-serif; color: var(--a-accent); margin-left: 2px; }

/* The clearing: a full-screen layer that grows out of the first opening (main.js animates it). */

html.in-clearing { overflow: hidden; }

.clearing {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background: #0a0a0b;
  outline: none;
}
.clearing[hidden] { display: none; }

.clearing-media {
  position: absolute;
  display: block;
  max-width: none;
  transform-origin: 0 0;
}
.clearing.is-open .clearing-media {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 62%);
}

.clearing-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0b;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.clearing-video.on { opacity: 1; }
.clearing:has(.clearing-video) .clearing-note { display: none; }

.clearing-close,
.clearing-note {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.clearing.is-open .clearing-close,
.clearing.is-open .clearing-note { opacity: 1; }

.clearing-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 11, 0.55);
  color: #ffffff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.clearing-close svg { width: 22px; height: 22px; }
.clearing-close:hover { background: rgba(10, 10, 11, 0.75); }
.clearing-close:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

.clearing-note {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: rgba(10, 10, 11, 0.55);
  color: #ffffff;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Footer. */

.foot { border-top: 1px solid var(--hair); background: var(--stage); transition: background-color 0.4s ease; }
.foot-in {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.75rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

@media (max-width: 640px) {
  /* The scenes scale with the height; on a phone that makes the opening as wide as the screen.
     Give each scene only part of the height, so the opening stays a find in an empty surface. */
  .slide-1 .scene { top: 12%; height: 56%; }
  .slide-2 .scene { height: 42%; }
  .slide-2 .wrap { justify-content: flex-end; padding-top: 1.25rem; }
  .wrap { padding: 1.25rem 1.25rem 2.25rem; }
  .slide-3 .wrap { padding: 3.5rem 1.25rem 3rem; }
  .foot-in { padding: 1.5rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
