/* Ink & Paper landing page. Paper texture is a pre-blended tile on the page itself:
   no fixed or blended full-screen layers, so scrolling repaints nothing extra. */
:root {
  --paper: #f3ede0;
  --paper-deep: #e9e1cf;
  --card: #f8f4ea;
  --ink: #1b1a17;
  --ink-soft: #4a463e;
  --muted: #776f61;
  --vermilion: #b8322a;
  --line: rgba(27, 26, 23, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --tile: url(./assets/img/paper-day.webp);
}
body.night {
  --paper: #191917;
  --paper-deep: #121210;
  --card: #22211e;
  --ink: #ece6d8;
  --ink-soft: #c9c1b0;
  --muted: #958d7e;
  --vermilion: #d8503c;
  --line: rgba(236, 230, 216, 0.14);
  --tile: url(./assets/img/paper-night.webp);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; color: var(--ink); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--paper) var(--tile) 0 0 / 600px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: var(--card); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }

/* ---- hero: the living ink painting ---- */
.hero { position: relative; height: 88vh; min-height: 600px; max-height: 960px; overflow: hidden; }
#ink, .hero-fallback { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
/* Crop mostly from the lake, so the painted sun or moon stays between the top buttons and the headline. */
.hero-fallback { object-fit: cover; object-position: 50% 12%; display: none; }
.no-gl .hero-fallback.day { display: block; }
.no-gl.night .hero-fallback.day { display: none; }
.no-gl.night .hero-fallback.night { display: block; }
.nav { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px max(24px, calc(50vw - 620px)); }
.logo { display: flex; align-items: center; gap: 11px; font: 500 22px var(--serif); text-decoration: none; }
.logo img { width: 34px; height: 34px; border-radius: 9px; }
.nav-r { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 15px; font-size: 14px; text-decoration: none; cursor: pointer; }
.pill svg { width: 15px; height: 15px; fill: currentColor; }

.hero-text { position: absolute; z-index: 2; left: 50%; top: max(14vh, 120px); transform: translateX(-50%); width: min(900px, calc(100% - 48px)); text-align: center; }
.hero-text::before { content: ""; position: absolute; inset: -50px -110px -40px; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 80%, transparent), transparent); pointer-events: none; }
.eyebrow { font: italic 17px var(--serif); color: var(--muted); margin: 0 0 14px; }
h1 { font: 400 clamp(34px, 4.6vw, 62px)/1.08 var(--serif); letter-spacing: -0.02em; margin: 0; }
h1 span { color: var(--ink-soft); font-style: italic; }
.lede { color: var(--ink-soft); margin: 20px auto 26px; max-width: 560px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn { text-decoration: none; border: 1px solid var(--ink); padding: 10px 20px; border-radius: 3px; font-size: 15px; background: var(--paper); }
.btn.ink { background: var(--ink); color: var(--paper); }
/* The app icon pressed like a seal into the painting; hover sends the cranes. The frame is a
   thin, see-through impression in muted vermilion with a broken edge (#seal-edge), not a border, and the icon
   is toned down so it sits in the wash instead of on top of it. */
.seal { --seal-ink: rgba(170, 58, 44, 0.82); position: absolute; z-index: 2; right: max(28px, calc(50vw - 600px)); bottom: 92px; margin: 0; width: 48px; height: 48px; transform: rotate(-1.5deg); cursor: pointer; }
.seal::before { content: ""; position: absolute; inset: 0; border: 2.5px solid var(--seal-ink); border-radius: 3px; filter: url(#seal-edge); }
/* Clipping off the icon's rounded app-tile corners leaves a square painting, as a chop would print. */
.seal img { position: absolute; inset: 1.5px; width: calc(100% - 3px); height: calc(100% - 3px); clip-path: inset(7.5%); filter: saturate(0.7) contrast(0.88) sepia(0.12); opacity: 0.88; }
.night .seal { --seal-ink: rgba(128, 56, 46, 0.9); }
.night .seal img { filter: saturate(0.6) brightness(0.76) contrast(0.92); opacity: 0.86; }

.kicker { font: italic 17px var(--serif); color: var(--vermilion); margin: 0 0 8px; }
h2 { font: 400 clamp(30px, 4vw, 46px)/1.1 var(--serif); margin: 0 0 16px; letter-spacing: -0.01em; }
.sub { color: var(--muted); max-width: 640px; }

/* ---- the demo, mounted like a scroll ---- */
.watch { max-width: 1260px; margin: 0 auto; padding: 4px 28px 70px; text-align: center; scroll-margin-top: 10px; }
.beats { list-style: none; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0; counter-reset: b; }
.beats li { counter-increment: b; }
.beats button { font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; transition: color 0.3s, border-color 0.3s; }
.beats button::before { content: counter(b) " "; opacity: 0.55; }
.beats li.past button { color: var(--ink-soft); }
.beats li.on button { color: var(--vermilion); border-color: var(--vermilion); }
.caption { color: var(--ink-soft); margin: 12px 0 18px; min-height: 1.6em; font: italic 18px var(--serif); }
.scroll-frame { position: relative; padding: 20px; background: var(--paper-deep); border-radius: 4px; box-shadow: 0 26px 50px -34px rgba(0, 0, 0, 0.55); --demo-height: 700px; }
/* The real app plays in a frame, loaded as the visitor comes near (demo/takode-demo.js). */
.demo-host { position: relative; height: var(--demo-height); border-radius: 3px; overflow: hidden; background: var(--card); }
.demo-host::before { content: "Opening Takode…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: italic 16px var(--serif); }
.demo-host.loaded::before { content: none; }
.demo-app { position: relative; display: block; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 0.5s; }
.demo-host.loaded .demo-app { opacity: 1; }
.scroll-frame::before, .scroll-frame::after { content: ""; position: absolute; left: -10px; right: -10px; height: 12px; border-radius: 6px; background: linear-gradient(#5a3b23, #2e1e12); }
.scroll-frame::before { top: -6px; }
.scroll-frame::after { bottom: -6px; }
/* Pressed on the paper below the scroll, clear of the app's own buttons. */
.stamp { position: absolute; right: -4px; bottom: -132px; opacity: 0; transform: scale(1.8) rotate(-12deg); pointer-events: none; }
.stamp.on { animation: stamp 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }

/* ---- differentiators ---- */
.why { max-width: 1160px; margin: 0 auto; padding: 70px 28px 50px; text-align: center; }
.why .sub { margin: 0 auto 44px; }
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 50px; text-align: left; }
.grid6 article { border-top: 1px solid var(--line); padding-top: 12px; }
.num { font: italic 30px var(--serif); color: var(--vermilion); }
.grid6 h3 { font: 500 22px/1.25 var(--serif); margin: 4px 0 8px; }
.grid6 p { color: var(--ink-soft); margin: 0; font-size: 15.5px; }

/* ---- the leader and its team ---- */
.team { max-width: 1240px; margin: 0 auto; padding: 80px 28px; display: grid; grid-template-columns: 5fr 7fr; gap: 50px; align-items: center; }
.team-text p:not(.kicker) { color: var(--ink-soft); }
.team-art { position: relative; height: 470px; }
.strokes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.strokes path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; opacity: 0.7; stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 1.6s cubic-bezier(0.6, 0, 0.3, 1); }
.strokes path:nth-child(2) { transition-delay: 0.15s; }
.strokes path:nth-child(3) { transition-delay: 0.3s; }
.strokes path.dash { stroke-width: 1.4; opacity: 0.45; transition-delay: 0.5s; }
.drawn .strokes path { stroke-dashoffset: 0; }
.drawn .strokes path.dash { stroke-dasharray: 4 7; }
.leader { position: absolute; left: 0; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; }
.leader img { width: 160px; height: 160px; border-radius: 50%; box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.6); }
.leader figcaption { font: italic 15px var(--serif); color: var(--muted); }
.slips { position: absolute; right: 0; top: 0; bottom: 0; width: 52%; display: flex; flex-direction: column; justify-content: space-between; }
.slip { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 9px 14px; box-shadow: 0 10px 20px -16px rgba(0, 0, 0, 0.6); font-size: 14.5px; opacity: 0; transform: translateX(16px); transition: opacity 0.6s 0.8s, transform 0.6s 0.8s; }
.slip:nth-child(2) { transition-delay: 0.9s; }
.slip:nth-child(3) { transition-delay: 1s; }
.slip:nth-child(4) { transition-delay: 1.1s; }
.slip:nth-child(5) { transition-delay: 1.2s; }
.drawn .slip { opacity: 1; transform: none; }
.drawn .slip.wait { opacity: 0.72; border-style: dashed; }
.slip b { font: 500 13px ui-monospace, Menlo, monospace; color: var(--vermilion); margin-right: 6px; }
.slip span { display: block; font: 12.5px ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slip span.flash { animation: inkin 0.7s ease; }

/* ---- feature rows ---- */
.feature { max-width: 1160px; margin: 0 auto; padding: 60px 28px; display: grid; grid-template-columns: 5fr 7fr; gap: 54px; align-items: center; }
.feature.flip .text { order: 2; }
.feature .text p:not(.kicker) { color: var(--ink-soft); }
.shot { margin: 0; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 24px 46px -32px rgba(0, 0, 0, 0.55); }
.shot img { display: block; width: 100%; border-radius: 2px; }
.shot a { display: block; cursor: zoom-in; }
.shot.narrow { max-width: 490px; justify-self: center; }
/* Each screenshot comes in the app's light and dark theme, following the page's day and night. */
.shot .night-shot, .night .shot .day-shot { display: none; }
.night .shot .night-shot { display: block; }
/* The app icon has a night version too, as in the app's dark theme. */
.night-only, .night .day-only { display: none !important; }
.night .night-only { display: block !important; }

.lq-sec { max-width: 1160px; margin: 0 auto; padding: 60px 28px; text-align: center; }
.lq-sec .sub { margin: 0 auto 32px; }
#lq { text-align: left; --lq-surface: var(--card); --lq-line: var(--line); --lq-blue: #2f6f9f; --lq-green: #2f8a57; --lq-red: var(--vermilion); }
.night #lq { --lq-blue: #63b3ed; --lq-green: #48bb78; }

.machines { max-width: 1160px; margin: 0 auto; padding: 60px 28px; text-align: center; }
.machines .sub { margin: 26px auto 0; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 760px; margin: 28px auto 0; }
.node { border: 1px solid var(--line); border-radius: 3px; padding: 14px; background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.node b { font: 500 19px var(--serif); }
.node span { color: var(--muted); font-size: 13.5px; }
.node.hub { grid-column: 1 / -1; justify-self: center; width: 320px; border-color: var(--vermilion); }

.start { text-align: center; padding: 60px 28px 34px; overflow: hidden; }
.start .sub { margin: 0 auto; }
.code { position: relative; display: inline-block; max-width: 100%; text-align: left; margin: 22px 0 12px; }
.code pre { margin: 0; font: 14px/1.85 ui-monospace, Menlo, monospace; background: var(--card); border: 1px solid var(--line); padding: 18px 90px 18px 24px; border-radius: 3px; overflow-x: auto; }
.code button { position: absolute; top: 10px; right: 10px; font-size: 12px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
.water { position: relative; height: 80px; margin-top: 26px; border-bottom: 1px solid var(--line); }
.boat { position: absolute; bottom: -2px; left: 0; width: 200px; animation: sail 48s steps(480) infinite; }
.night .boat { filter: invert(0.85); }
.foot { color: var(--muted); font: italic 15px var(--serif); display: flex; gap: 12px; align-items: center; justify-content: center; margin: 26px 0 0; }
.foot img { width: 44px; border-radius: 50%; }

@keyframes inkin { from { opacity: 0; filter: blur(3px); } }
@keyframes stamp { to { opacity: 0.94; transform: scale(1) rotate(-6deg); } }
@keyframes sail { from { transform: translateX(-220px); } to { transform: translateX(100vw); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 820px) {
  .hero { height: 86vh; min-height: 560px; }
  h1 br, .why h2 br { display: none; }
  .hero-text { top: 84px; }
  .pill .lbl { display: none; }
  .pill { padding: 8px 10px; }
  /* Phones see the lake here, so the seal sits in the corner like a painter's chop, never over water. */
  .seal { width: 40px; height: 40px; right: 14px; bottom: 12px; }
  .watch { padding: 0 12px 50px; }
  .beats { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px; }
  .beats::-webkit-scrollbar { display: none; }
  .beats button { white-space: nowrap; }
  .caption { font-size: 16px; margin: 10px 0 14px; }
  .scroll-frame { padding: 8px; --demo-height: 640px; }
  .stamp { right: 14px; bottom: -78px; }
  .grid6 { grid-template-columns: 1fr; gap: 26px; }
  .team { grid-template-columns: 1fr; padding: 60px 20px 40px; gap: 24px; }
  .team-art { height: 560px; }
  .leader { top: 0; left: 50%; transform: translateX(-50%); }
  .leader img { width: 108px; height: 108px; }
  .slips { left: 30px; right: 0; top: 160px; width: auto; justify-content: flex-start; gap: 10px; }
  .feature { grid-template-columns: 1fr; gap: 22px; padding: 44px 20px; }
  .feature.flip .text { order: 0; }
  .mgrid { grid-template-columns: 1fr; }
  .node.hub { width: auto; }
}
