/* afterwork labs — declutter site design (tokens mirror declutter/site/styles.css): cool white,
   one blue accent, Pretendard only. Motion lives at the bottom, scoped to html.motion (set by
   motion.js only when motion is allowed); without it every scene is laid out statically. */

/* Wordmark (nav + footer) only. Fraunces 600 (SIL OFL 1.1, fonts/Fraunces-OFL.txt), subset to the
   letters of "afterwork labs" — add glyphs to the file before using it for any other text. */
@font-face {
  font-family: "Fraunces Wordmark"; font-weight: 600; font-display: swap;
  src: url(fonts/fraunces-wordmark.woff2) format("woff2");
}

:root {
  --paper: #FCFCFF;
  --paper-2: #F5F5F8;
  --ink: #1D1D1F;
  --ink-2: #666666;
  --hairline: #E0E0E0;
  --accent: #0066CC;
  --accent-bright: #0088FF;
  --declutter: var(--accent);
  --photos: #D6336C;
  --tint: var(--ink);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 144px;
  --radius: 16px;
  --content: 1040px;
  --nav-h: 64px;

  --sans: "Pretendard Variable", Pretendard, -apple-system, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  /* One family: the heading roles keep their names so the rules below stay unchanged. */
  --serif: var(--sans);
  --serif-en: var(--sans);
  --print-shadow: 0 0 0 1px var(--hairline), 0 16px 32px -16px rgb(0 0 0 / 0.3);

  /* Motion tokens. Only transform/opacity animate. */
  --dur-fast: 180ms;
  --dur-normal: 350ms;
  --dur-slow: 700ms;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-settle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --rise: 24px;

  color-scheme: light;
}
/* theme.js sets data-theme from the stored choice or the system preference. */
:root[data-theme="dark"] {
  --paper: #0B0C0E;
  --paper-2: #1E2024;
  --ink: #F2F2F4;
  --ink-2: #A1A1A6;
  --hairline: #2A2D33;
  --accent: #3B9EFF;
  --accent-bright: #409CFF;
  --photos: #FF7FA3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: anywhere; overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
main p a, .more { color: var(--accent); }
em { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--content); margin-inline: auto; padding-inline: var(--s5); }
.tint-declutter { --tint: var(--declutter); }
.tint-photos { --tint: var(--photos); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10; height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: "Fraunces Wordmark", var(--sans); font-size: 20px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.nav nav { display: flex; gap: var(--s2); white-space: nowrap; }
.logo { white-space: nowrap; }
.nav nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  font-size: 15px; color: var(--ink-2); text-decoration: none; border-radius: 999px;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.nav nav a:hover, .theme-toggle:hover { color: var(--ink); background: var(--paper-2); }
.nav nav { align-items: center; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.theme-toggle svg { width: 20px; height: 20px; }
/* The icon shows where a click takes you: moon in light, sun in dark. */
.theme-toggle .sun, [data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5);
  border-radius: 999px; background: var(--accent); color: #FFFFFF;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-smooth);
}
a.btn:active { transform: scale(0.97); }
/* "Coming soon" pill, as on the declutter site: hairline border, accent dot. */
.btn.soon {
  min-height: 36px; padding: 0 var(--s3); background: none; border: 1px solid var(--hairline);
  font-size: 14px; color: var(--ink-2);
}
.btn.soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tint); }

/* ---------- Photo tiles ---------- */
.print {
  width: var(--w, 96px); overflow: hidden;
  box-shadow: var(--print-shadow); border-radius: 14px; rotate: var(--r, 0deg);
}
/* 512px WebP, metadata stripped (originals live in img/src/, git-ignored).
   1-4 and 7 are the keepers; 5, 6, 8, 9 are the ones that get cleared; 10 is a spare. */
.ph { display: block; aspect-ratio: 1; background: var(--paper-2) center / cover no-repeat; }
.ph-1 { background-image: url(img/photos/keep-1.webp); }
.ph-2 { background-image: url(img/photos/keep-2.webp); }
.ph-3 { background-image: url(img/photos/keep-3.webp); }
.ph-4 { background-image: url(img/photos/keep-4.webp); }
.ph-7 { background-image: url(img/photos/keep-5.webp); }
.ph-5 { background-image: url(img/photos/drop-1.webp); }
.ph-6 { background-image: url(img/photos/drop-2.webp); }
.ph-8 { background-image: url(img/photos/drop-3.webp); }
.ph-9 { background-image: url(img/photos/drop-4.webp); }
.ph-10 { background-image: url(img/photos/extra-1.webp); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s7); align-items: center;
  min-height: calc(100svh - var(--nav-h) - 120px); padding-block: var(--s7) var(--s8);
}
.eyebrow { font-weight: 600; color: var(--accent); margin-bottom: var(--s4); }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5vw, 58px); line-height: 1.22; letter-spacing: -.02em; margin-bottom: var(--s5); }
.lead { color: var(--ink-2); font-size: 18px; max-width: 28em; margin-bottom: var(--s6); }
.pile { position: relative; aspect-ratio: 1; width: 100%; max-width: 440px; justify-self: center; }
.pile .print { position: absolute; }

/* ---------- Journey (static layout: final state, steps listed) ---------- */
.journey { --p: 1; --a: 1; --b: 1; padding-block: var(--s9); }
.journey .stage { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: center; }
.steps { display: grid; gap: var(--s7); }
.step-no { font: 600 13px/1 var(--sans); letter-spacing: .08em; color: var(--tint); margin-bottom: var(--s4); }
.steps li:first-child .step-no { color: var(--ink-2); }
.steps h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4.2vw, 46px); line-height: 1.25; letter-spacing: -.02em; margin-bottom: var(--s4); }
.steps li[class] h2 { color: var(--tint); }
.steps li > p:last-child { color: var(--ink-2); max-width: 24em; }

/* The board is a square; children are placed in cqw so everything scales with it. */
.board { position: relative; container-type: inline-size; aspect-ratio: 1; width: min(100%, 520px); justify-self: center; }
.cal-title { position: absolute; left: 8.6cqw; top: 3cqw; font-family: var(--serif); font-weight: 700; font-size: 6cqw; line-height: 1; opacity: var(--b); }
.cal-title em { font-family: var(--serif-en); font-size: 3.4cqw; color: var(--ink-2); margin-left: 1cqw; }
.cal-week, .cal-grid {
  position: absolute; left: 8.6cqw; display: grid; grid-template-columns: repeat(7, 10.8cqw); column-gap: 1.2cqw; opacity: var(--b);
}
.cal-week { top: 15cqw; font-size: 2.4cqw; color: var(--ink-2); text-align: center; }
.cal-week b { font-weight: 500; }
.cal-grid { top: 21.7cqw; grid-auto-rows: 12.6cqw; row-gap: 1.4cqw; }
.cal-grid i { border-radius: 1cqw; background: var(--paper-2); font: 500 2.2cqw/1 var(--sans); color: var(--ink-2); padding: 1cqw; }
.cal-grid i:empty { background: none; }

.jp {
  position: absolute; left: 0; top: 0; width: 30cqw; overflow: hidden;
  box-shadow: var(--print-shadow); border-radius: 4cqw;
}
.jp.keep {
  --x: calc(var(--x0) + (var(--x1) - var(--x0)) * var(--b));
  --y: calc(var(--y0) + (var(--y1) - var(--y0)) * var(--b));
  translate: calc(var(--x) * 1cqw - 50%) calc(var(--y) * 1cqw - 50%);
  rotate: calc(var(--r0) * (1 - var(--b)) * 1deg);
  scale: calc(1 - .64 * var(--b));
}
.jp.drop {
  translate: calc((var(--x0) + var(--dx) * var(--a)) * 1cqw - 50%) calc((var(--y0) + 6 * var(--a)) * 1cqw - 50%);
  rotate: calc((var(--r0) + var(--dr) * var(--a)) * 1deg);
  opacity: calc(1 - var(--a) * 1.4);
}

/* ---------- Sections ---------- */
.section { padding-block: var(--s9); border-top: 1px solid var(--hairline); }
.section-title { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4.2vw, 46px); line-height: 1.25; letter-spacing: -.02em; margin-bottom: var(--s7); }

/* ---------- Apps ---------- */
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.app {
  display: flex; flex-direction: column; background: var(--paper-2); border-radius: var(--radius); padding: var(--s6);
  transition: transform var(--dur-normal) var(--ease-smooth), box-shadow var(--dur-normal) var(--ease-smooth);
}
.app:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(42,37,33,.10); }
.app-top { display: flex; justify-content: space-between; align-items: flex-start; height: 148px; margin-bottom: var(--s4); }
.app-top > img { border-radius: 16px; box-shadow: var(--print-shadow); }
.fan { position: relative; width: 190px; height: 140px; }
.fan .print { position: absolute; top: 8px; --w: 92px; transition: translate var(--dur-normal) var(--ease-settle), rotate var(--dur-normal) var(--ease-settle); }
.fan .print:nth-child(1) { left: 6px; }
.fan .print:nth-child(2) { left: 48px; }
.fan .print:nth-child(3) { left: 90px; }
.app:hover .fan .print:nth-child(1) { translate: -10px 4px; rotate: -18deg; }
.app:hover .fan .print:nth-child(3) { translate: 10px 4px; rotate: 22deg; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 24px); gap: 5px; }
.mini-cal i { aspect-ratio: 1; border-radius: 4px; background-color: var(--hairline); transition: scale var(--dur-normal) var(--ease-settle); }
.mini-cal .ph { border-radius: 6px; }
.app:hover .mini-cal .ph { scale: 1.18; }
.verb { font-size: 15px; font-weight: 600; color: var(--tint); }
.app h3 { font-family: var(--serif-en); font-weight: 600; font-size: 34px; line-height: 1.2; letter-spacing: -.01em; margin-block: var(--s1) var(--s2); }
.tagline { font-family: var(--serif); font-size: 19px; margin-bottom: var(--s5); }
.app ul { display: grid; gap: var(--s2); color: var(--ink-2); font-size: 16px; margin-bottom: var(--s6); flex: 1; align-content: start; }
.app li { position: relative; padding-left: var(--s5); }
.app li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 1.5px; background: var(--tint); }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.more { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; text-underline-offset: 4px; }

/* ---------- About / FAQ: title left, list right ---------- */
.about, .faq { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: start; }
.about .section-title, .faq .section-title { margin-bottom: var(--s5); }
.about-body { color: var(--ink-2); max-width: 24em; }
.principles { display: grid; }
.principles li { padding-block: var(--s5); border-top: 1px solid var(--hairline); }
.principles li:last-child { border-bottom: 1px solid var(--hairline); }
.principles strong { display: block; font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; letter-spacing: -.02em; margin-bottom: var(--s2); }
.principles span { color: var(--ink-2); font-size: 16px; }

.faq-list { border-top: 1px solid var(--hairline); }
.faq-list details { border-bottom: 1px solid var(--hairline); }
.faq-list summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  min-height: 64px; padding-block: var(--s4); cursor: pointer; list-style: none;
  font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.4;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; font: 400 24px/1 var(--sans); color: var(--ink-2); transition: rotate var(--dur-fast) var(--ease-smooth); }
.faq-list details[open] summary::after { rotate: 45deg; }
.faq-list details p { color: var(--ink-2); font-size: 16px; padding-bottom: var(--s5); max-width: 36em; }

/* ---------- Pricing page ---------- */
.nav nav a[aria-current="page"] { color: var(--ink); }
.pricing { padding-block: var(--s8) var(--s9); }
.pricing h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5vw, 58px); line-height: 1.22; letter-spacing: -.02em; margin-bottom: var(--s4); }
.price-app { margin-top: var(--s8); }
.price-app h2 { display: flex; align-items: center; gap: var(--s3); font-family: var(--serif-en); font-weight: 600; font-size: 30px; letter-spacing: -.01em; }
.price-app h2 img { border-radius: 10px; box-shadow: var(--print-shadow); }
.price-intro { margin-top: var(--s3); color: var(--ink-2); }
.plans { margin-top: var(--s5); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.plan { background: var(--paper-2); border-radius: var(--radius); padding: var(--s5); }
.plan h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.plan .price { margin-top: var(--s1); font-family: var(--serif); font-weight: 700; font-size: 28px; }
.plan.pick .price { color: var(--tint); }
.plan ul { display: grid; gap: var(--s1); margin-top: var(--s3); color: var(--ink-2); font-size: 16px; }
.price-app:has(.plan:only-child) .plans { grid-template-columns: minmax(220px, 340px); }
.fine { margin-top: var(--s4); font-size: 14px; color: var(--ink-2); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--hairline); padding-block: var(--s7) var(--s8); font-size: 13px; color: var(--ink-2); }
footer .logo { display: block; margin-bottom: var(--s3); }
footer dl { display: flex; flex-wrap: wrap; gap: 2px var(--s4); margin-bottom: var(--s2); }
footer dl div { display: flex; gap: 6px; }
footer dt { color: var(--ink); flex: none; }
footer dd { margin: 0; }
.copy { margin-top: var(--s4); }

/* ---------- Narrow screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: var(--s6); gap: var(--s6); }
  .pile { max-width: 320px; }
  .journey .stage { grid-template-columns: 1fr; }
  .journey .board { order: -1; }
  .apps, .about, .faq { grid-template-columns: 1fr; }
  .about, .faq { gap: var(--s6); }
  .faq .section-title br { display: none; }
  .section, .journey { padding-block: var(--s8); }
  .app { padding: var(--s5); }
  .fan { scale: .85; transform-origin: top right; }
  .nav nav a { padding: 0 var(--s2); }
}
@media (max-width: 600px) {
  /* Needs the .nav nav prefix to outrank `.nav nav a { display: inline-flex }`. */
  .nav nav .nav-sec { display: none; }
}

/* Cross-page transitions (ko/en, home/pricing): the nav stays, the page slides under it. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .nav { view-transition-name: nav; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
  ::view-transition-old(root) { animation: vt-out var(--dur-fast) var(--ease-smooth) both; }
  ::view-transition-new(root) { animation: vt-in var(--dur-normal) var(--ease-smooth) both; }
}

/* ==================== Motion (html.motion only) ==================== */
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } }
@keyframes drop { from { opacity: 0; scale: 1.12; } }
@keyframes bob { to { translate: 0 -8px; } }

.motion .hero-copy > * { animation: rise var(--dur-slow) var(--ease-smooth) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: 90ms; }
.motion .hero-copy > :nth-child(3) { animation-delay: 180ms; }
.motion .hero-copy > :nth-child(4) { animation-delay: 270ms; }
.motion .pile .print {
  animation:
    drop var(--dur-slow) var(--ease-settle) both calc(var(--i) * 110ms + 250ms),
    bob 5s ease-in-out infinite alternate calc(var(--i) * -1.3s);
}

.motion [data-reveal] { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--dur-slow) var(--ease-smooth), transform var(--dur-slow) var(--ease-smooth); }
.motion [data-reveal].in { opacity: 1; transform: none; }
.motion .app[data-reveal].in:hover { transform: translateY(-4px); }
.motion .apps .app:nth-child(2) { transition-delay: 90ms; }
.motion [data-lit] { opacity: calc(.25 + .75 * var(--lit, 0)); }

/* Journey: pinned stage; --a = clutter leaving (step 2), --b = keepers landing on the calendar (step 3). */
.motion .journey {
  height: 340vh; padding-block: 0;
  /* Steps switch at p = 1/3 and 2/3 (motion.js); each move straddles its step's start. */
  --a: clamp(0, calc((var(--p) - .3) / .2), 1);
  --b: clamp(0, calc((var(--p) - .64) / .24), 1);
}
.motion .journey .stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); overflow: clip; }
.motion .steps { gap: 0; }
.motion .steps li { grid-area: 1 / 1; opacity: 0; transform: translateY(16px); transition: opacity var(--dur-normal) var(--ease-smooth), transform var(--dur-normal) var(--ease-smooth); }
.motion .journey[data-active="0"] .steps li:nth-child(1),
.motion .journey[data-active="1"] .steps li:nth-child(2),
.motion .journey[data-active="2"] .steps li:nth-child(3) { opacity: 1; transform: none; }
.motion .board { width: min(100%, 520px, 78svh); }
@media (max-width: 820px) {
  .motion .journey .stage { align-content: center; gap: var(--s5); }
  .motion .board { width: min(100%, 46svh); }
  .motion .steps li { min-height: 13em; }
}
