/* Tapasya, the website.
   The same brand as the app: identical squares, one per day, and the last one, today, is lit.
   Warm black and bone; ember marks what is live and what you can act on; the six papers keep their colours. */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F3F2EE;
  --sheet: #FBFAF7;
  --ink: #111110;
  --ink-2: #4D4C48;
  --ink-3: #66655F;
  --rule: #D6D4CC;
  --rule-soft: #E5E3DC;
  --wash: #EAE8E2;
  --wash-2: #DEDCD4;
  --ember: #F68C36;
  --ember-ink: #A64B00;
  --on-ember: #0C0C0B;
  --sq: #111110;                       /* a kept day */
  --sq-off: #DEDCD4;                   /* a day not kept */
  --glow: rgba(246, 140, 54, .28);
  --shadow: 0 1px 2px rgba(17, 17, 16, .06), 0 24px 48px -16px rgba(17, 17, 16, .22);

  --fr: #3987E5; --afm: #008300; --audit: #1BAF7A; --dt: #6D4FD8; --idt: #C98500; --ibs: #C94F9B;

  --sans: "Sora", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --t-12: .78125rem;
  --t-14: .875rem;
  --t-17: 1.0625rem;
  --t-21: 1.3125rem;
  --t-28: 1.75rem;
  --t-40: 2.5rem;
  --t-56: 3.5rem;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C0C0B; --sheet: #161615; --ink: #ECEBE8; --ink-2: #A9A8A3; --ink-3: #8B8A84;
    --rule: #2B2B28; --rule-soft: #1E1E1C; --wash: #1A1A18; --wash-2: #262624;
    --ember-ink: #F68C36; --sq: #ECEBE8; --sq-off: #262624; --glow: rgba(246, 140, 54, .22);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C0C0B; --sheet: #161615; --ink: #ECEBE8; --ink-2: #A9A8A3; --ink-3: #8B8A84;
  --rule: #2B2B28; --rule-soft: #1E1E1C; --wash: #1A1A18; --wash-2: #262624;
  --ember-ink: #F68C36; --sq: #ECEBE8; --sq-off: #262624; --glow: rgba(246, 140, 54, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-17)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
h1, h2, h3, p, ul, ol { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ember-ink); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ember); color: var(--on-ember); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ember); color: var(--on-ember); padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */

.display {
  font-weight: 200;
  font-size: clamp(2.6rem, 7.4vw, 6rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.h2 {
  font-weight: 250;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  max-width: 18ch;
}
.h3 { font-weight: 500; font-size: var(--t-21); line-height: 1.25; letter-spacing: -.01em; }
.lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 54ch; font-weight: 300; }
.body { color: var(--ink-2); max-width: 60ch; }
.small { font-size: var(--t-14); }
.faint { color: var(--ink-3); }
.kicker { font-size: var(--t-14); color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.kicker::before { content: ""; width: 10px; height: 10px; border-radius: 2.5px; background: var(--ember); flex: none; }

/* the headline's words arrive one after another */
.words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.words .w > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 70ms + var(--d, 0ms)); }
.words.in .w > span { transform: none; }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px;
  border-radius: 12px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink);
  font-weight: 500; font-size: var(--t-17); text-decoration: none; white-space: nowrap;
  transition: transform .35s var(--ease), background-color .25s, border-color .25s, box-shadow .35s var(--ease);
  overflow: hidden; isolation: isolate;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--ember); border-color: var(--ember); color: var(--on-ember); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 14px 30px -10px var(--glow), 0 0 0 6px color-mix(in oklab, var(--ember) 18%, transparent); }
.btn.primary::after {                 /* a slow sheen across the ember */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 5.5s var(--ease) 2.2s infinite;
}
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn.small { height: 40px; padding: 0 16px; font-size: var(--t-14); border-radius: 10px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.link { color: var(--ember-ink); text-decoration: none; font-weight: 500; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.link:hover { background-size: 100% 1px; }

/* ---------- the mark ---------- */

.mark .sq { fill: var(--sq); }
.mark .sq.today { fill: var(--ember); }
.mark.assemble .sq { animation: arrive .52s var(--ease) both; animation-delay: calc(var(--i) * 90ms + var(--d, 0ms)); transform-box: fill-box; transform-origin: center; }
@keyframes arrive { from { opacity: 0; transform: translateY(-14px) scale(.6); } to { opacity: 1; transform: none; } }
.mark .sq.today.breathe { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

/* ---------- header ---------- */

.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background-color .35s, border-color .35s, backdrop-filter .35s, transform .45s var(--ease);
  border-bottom: 1px solid transparent;
}
.top.solid {
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--rule-soft);
}
.top.hide { transform: translateY(-100%); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.lockup .mark { height: 30px; width: auto; }
.lockup .word { font-size: 1.3125rem; font-weight: 400; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: var(--t-14); font-weight: 500; transition: color .2s, background-color .2s; }
.nav a:not(.btn):hover { color: var(--ink); background: var(--wash); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav .btn { margin-left: 8px; }
.theme {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: none;
  display: grid; place-items: center; color: var(--ink-2); transition: background-color .2s, color .2s;
}
.theme:hover { background: var(--wash); color: var(--ink); }
.theme svg { width: 18px; height: 18px; transition: transform .6s var(--ease); }
.theme:active svg { transform: rotate(-90deg); }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .nav { position: fixed; inset: 72px 0 auto; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px;
    background: var(--paper); border-bottom: 1px solid var(--rule); transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .35s var(--ease), visibility .25s; }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav a:not(.btn) { padding: 12px; font-size: var(--t-17); }
  .nav .btn { margin: 8px 0 0; height: 48px; }
  .menu-btn { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; color: var(--ink); }
  .menu-btn svg { width: 22px; height: 22px; }
  .theme { order: 3; }
}

/* ---------- flowing squares behind a page ---------- */

.field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- reveal on scroll ---------- */

.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }

/* ---------- sections ---------- */

main { position: relative; }
.sec { position: relative; padding: clamp(88px, 13vw, 168px) 0; }
.sec-head { display: grid; gap: 22px; margin-bottom: clamp(48px, 7vw, 88px); }
.rule-top { border-top: 1px solid var(--rule-soft); }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--rule-soft); padding: 56px 0 40px; position: relative; overflow: hidden; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot h4 { margin: 0 0 14px; font-size: var(--t-14); font-weight: 500; color: var(--ink); }
.foot ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.foot li a { color: var(--ink-2); text-decoration: none; font-size: var(--t-14); transition: color .2s; }
.foot li a:hover { color: var(--ember-ink); }
.foot .about { color: var(--ink-2); font-size: var(--t-14); max-width: 40ch; margin-top: 18px; }
.foot .legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; border-top: 1px solid var(--rule-soft); color: var(--ink-3); font-size: var(--t-12); }
.foot-strokes { display: flex; align-items: flex-end; gap: 5px; height: 28px; }
.foot-strokes i { width: 5px; border-radius: 3px; background: var(--sq); height: 100%; transform-origin: bottom; animation: wave 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 120ms); }
.foot-strokes i:last-child { background: var(--ember); }
@keyframes wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.35); } }
@media (max-width: 720px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .wrap > :first-child { grid-column: 1 / -1; } }

/* ---------- page hero for inner pages ---------- */

.page-hero { position: relative; padding: 168px 0 72px; overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero .display { font-size: clamp(2.4rem, 6vw, 4.6rem); max-width: 14ch; }
.page-hero .lede { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
  .words .w > span { transform: none; }
}

/* the live dot (shared: header and pages) */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; display: inline-block; }
.dot.live { background: var(--ember); box-shadow: 0 0 0 0 color-mix(in oklab, var(--ember) 55%, transparent); animation: ping 2s ease-out infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.nav a.nav-strict { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
