/* ConkerLab website: the studio's design system (docs/brand-system.md) and the components every page shares.
   An app's own look is a layer on top: assets/<app>/<app>.css redefines these tokens under :root[data-app="<app>"]. */

/* MARK: - Tokens */

:root {
  --ink: #1b231d;
  --ink-soft: #566159;
  --page: #f3f6f1;
  --sheet: #ffffff;
  --rule: #d8dfd4;
  --accent: #6b2a12;
  --accent-wash: color-mix(in srgb, var(--accent) 13%, transparent);
  --spark: #5f8a1f;
  --focus: #1f5fd0;
  --btn-bg: var(--accent);
  --btn-ink: #ffffff;
  --shadow: 0 1px 0 rgb(27 35 29 / 0.04), 0 18px 50px -14px rgb(27 35 29 / 0.28), 0 0 0 0.5px rgb(27 35 29 / 0.14);
  --brand-font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "New York", ui-serif, "Iowan Old Style", Charter, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: var(--brand-font);
  --prose: var(--sans);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --frame: 72rem;
  --measure: 38rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9eee6;
    --ink-soft: #a0ab9f;
    --page: #141a15;
    --sheet: #1c241d;
    --rule: #2c382d;
    --accent: #e5a06b;
    --spark: #a4cb5b;
    --focus: #7aa7ff;
    --btn-ink: #1a0f08;
    --shadow: 0 18px 50px -14px rgb(0 0 0 / 0.6), 0 0 0 0.5px rgb(255 255 255 / 0.12);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #e9eee6;
  --ink-soft: #a0ab9f;
  --page: #141a15;
  --sheet: #1c241d;
  --rule: #2c382d;
  --accent: #e5a06b;
  --spark: #a4cb5b;
  --focus: #7aa7ff;
  --btn-ink: #1a0f08;
  --shadow: 0 18px 50px -14px rgb(0 0 0 / 0.6), 0 0 0 0.5px rgb(255 255 255 / 0.12);
  color-scheme: dark;
}

/* MARK: - Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
:root[data-app] { scroll-padding-top: 128px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/27px var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); transition: text-decoration-color 180ms var(--ease); }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
code { padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
kbd { padding: 0 4px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; background: var(--sheet); font-size: 0.82em; white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--focus) 28%, transparent); }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--ink); color: var(--page); border-radius: 8px; z-index: 50; }
.skip:focus { left: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--frame); margin: 0 auto; padding: 0 24px; }
.col { max-width: var(--measure); }

/* MARK: - Type */

.display, h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
.display { font-size: 56px; line-height: 60px; }
h1 { font-size: 44px; line-height: 50px; }
h2 { font-size: 34px; line-height: 40px; font-weight: 500; }
h3 { font: 600 21px/28px var(--sans); margin: 0; letter-spacing: -0.005em; }
p { margin: 0 0 16px; }
.lede { font: 400 21px/32px var(--prose); color: var(--ink-soft); max-width: 36rem; margin-top: 20px; }
.small { font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.reading { font: 400 19px/31px var(--prose); max-width: 40rem; }
.reading h2 { font-size: 27px; line-height: 34px; margin: 48px 0 12px; }
.reading h3 { margin: 28px 0 8px; }
.reading ul, .reading ol { padding-left: 1.2em; }
.reading li { margin-bottom: 6px; }

/* MARK: - Header and footer */

.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.mark { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 700 21px/1 var(--brand-font); letter-spacing: -0.01em; }
.mark svg { width: 26px; height: 26px; color: var(--accent); }
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.head-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.appearance { appearance: none; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.appearance svg { width: 16px; height: 16px; }
.menu-toggle { display: none; }

.site-foot { margin-top: 128px; border-top: 1px solid var(--rule); padding: 48px 0 64px; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { text-decoration: underline; }
.foot-legal { margin-top: 40px; display: grid; gap: 6px; font-size: 13px; line-height: 19px; }

/* MARK: - Sections */

main { display: block; }
.hero { padding: 88px 0 32px; }
.section { padding-top: 96px; }
.section > .wrap > .col > h2 + p, .section-head p { margin-top: 16px; }
.section-head { max-width: var(--measure); margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); }
.page-head { padding: 72px 0 8px; }
.page-head .lede { margin-bottom: 0; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 32px; }
.price-line { font-size: 15px; color: var(--ink-soft); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink); font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer; transition: transform 180ms var(--ease), background 180ms var(--ease); }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--ink); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }

/* The App Store badge: Apple's artwork goes here, unmodified (brand-system.md, Components). */
.badge-slot { display: inline-grid; place-items: center; height: 48px; min-width: 160px; padding: 0 14px; border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 10px; color: var(--ink-soft); font-size: 12px; line-height: 15px; text-align: center; text-decoration: none; margin: 12px; }
.badge-slot strong { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
.badge-wrap { display: inline-block; margin: -12px; }

.figure { margin: 0; }
.figure figcaption { max-width: var(--measure); margin-top: 16px; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.figure figcaption button { margin-left: 8px; }
.stage { display: flex; justify-content: center; }

.note { border-left: 3px solid var(--rule); padding: 2px 0 2px 16px; color: var(--ink-soft); }

/* A sequence that really is one: the loop of a working day. */
.loop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: loop; }
.loop li { counter-increment: loop; padding-top: 20px; border-top: 1px solid var(--rule); position: relative; }
.loop li::before { content: counter(loop); position: absolute; top: -14px; left: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--page); border: 1px solid var(--rule); display: grid; place-items: center; font: 600 13px/1 var(--sans); color: var(--ink-soft); }
.loop li.lit::before { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.loop h3 { font-size: 17px; line-height: 24px; margin-bottom: 6px; }
.loop p { font-size: 15px; line-height: 23px; color: var(--ink-soft); margin: 0; }

.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.answers h3 { font: 500 24px/30px var(--display); margin-bottom: 10px; }
.answers p { color: var(--ink-soft); }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 40px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.trust strong { display: block; font: 500 21px/28px var(--display); margin-bottom: 6px; }
.trust span { color: var(--ink-soft); font-size: 15px; line-height: 23px; }

.closing { padding: 96px 0 0; }
.closing h2 { max-width: 30rem; }

/* MARK: - Tour */

.chapter { padding-top: 112px; }
.chapter > .wrap > h2 { max-width: var(--measure); }
.chapter > .wrap > .chapter-lede { max-width: var(--measure); color: var(--ink-soft); margin-top: 12px; font: 400 19px/29px var(--prose); }
.feature { margin-top: 64px; display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 48px; align-items: start; }
.feature .text h3 { margin-bottom: 10px; }
.feature .text p { color: var(--ink-soft); }
.feature .text .keys { font-size: 14px; color: var(--ink-soft); }
.feature .figure { min-width: 0; }

.site-ruler { position: fixed; right: 10px; top: 96px; bottom: 32px; width: 10px; z-index: 15; }
.site-ruler::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--rule); }
.site-ruler a { position: absolute; left: 0; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--page); border: 2px solid var(--rule); }
.site-ruler a[aria-current="true"] { background: var(--ink); border-color: var(--ink); }
.site-ruler a span { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; background: var(--sheet); border: 1px solid var(--rule); padding: 2px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease); }
.site-ruler a:hover span, .site-ruler a:focus-visible span { opacity: 1; }

/* MARK: - Pricing, support, changelog */

.offer { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.price { font: 600 64px/1 var(--display); letter-spacing: -0.02em; }
.price small { font: 400 17px/1 var(--sans); color: var(--ink-soft); margin-left: 8px; letter-spacing: 0; }
.included { list-style: none; padding: 0; margin: 24px 0 0; }
.included li { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.included li svg { width: 16px; height: 16px; margin-top: 5px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 24px 28px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-soft); background: var(--page); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--rule); }
.timeline li:last-child::after { display: none; }

.faq details { border-top: 1px solid var(--rule); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-soft); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { margin-top: 10px; color: var(--ink-soft); max-width: 40rem; }

.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 40px; }
.contact div { border-top: 1px solid var(--rule); padding-top: 16px; }
.contact strong { display: block; margin-bottom: 4px; }

.release { padding: 28px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 12rem 1fr; gap: 32px; position: relative; }
.release h2 { font-size: 27px; line-height: 32px; }
.release .meta { font-size: 15px; color: var(--ink-soft); }
.release ul { margin: 0; padding-left: 1.1em; }
.release.new::before { content: ""; position: absolute; left: -16px; top: 28px; bottom: 28px; width: 3px; border-radius: 2px; background: var(--accent); }
.release.new .body { animation: glow 5s var(--ease) forwards; border-radius: 6px; }
.since { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--ink); background: var(--accent-wash); padding: 1px 8px; border-radius: 999px; }

.commands pre, pre.block { background: var(--terminal); color: var(--terminal-ink); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 22px; margin: 16px 0 24px; }
pre.block .c { color: var(--terminal-soft); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: 28px 0 8px 56px; border-top: 1px solid var(--rule); }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 26px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); display: grid; place-items: center; font: 600 14px/1 var(--sans); color: var(--ink-soft); }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-soft); max-width: var(--measure); }

@keyframes glow { 0%, 12% { background-color: var(--accent-wash); } 100% { background-color: transparent; } }

/* MARK: - The app bar: an app's own pages, under the studio header */

.appbar { position: sticky; top: 60px; z-index: 19; background: color-mix(in srgb, var(--sheet) 90%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent); }
.appbar .wrap { display: flex; align-items: center; gap: 24px; height: 48px; overflow-x: auto; scrollbar-width: none; }
.appbar .wrap::-webkit-scrollbar { display: none; }
.app-name { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 600 16px/1 var(--sans); white-space: nowrap; }
.app-name img { border-radius: 5px; }
.appnav { display: flex; gap: 20px; margin-left: 4px; }
.appnav a { text-decoration: none; font-size: 14px; color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.appnav a:hover { color: var(--ink); }
.appnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.appbar .btn { margin-left: auto; flex: none; }

.foot-app { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); display: grid; gap: 20px; }
.foot-app ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-app a { text-decoration: none; }
.foot-app a:hover { text-decoration: underline; }

/* MARK: - The studio: the hanging conker, the shelf, how we make things */

.studio-hero { padding: 0 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.hero-copy { padding-top: 88px; }
.hero-copy .display { max-width: 15ch; }
.conker-hang { appearance: none; border: 0; background: none; padding: 0; margin: 0 auto; width: min(100%, 220px); cursor: pointer; display: block; }
.conker-hang svg { width: 100%; height: auto; overflow: visible; }
.conker-hang .swing { transform-origin: 120px 0; }
.conker-hang .swing.go { animation: swing 3.6s cubic-bezier(0.35, 0.1, 0.3, 1) both; }
@keyframes swing { 0% { transform: rotate(19deg); } 17% { transform: rotate(-14deg); } 35% { transform: rotate(9deg); } 53% { transform: rotate(-5.5deg); } 70% { transform: rotate(3deg); } 85% { transform: rotate(-1.2deg); } 100% { transform: rotate(0); } }

.shelf { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.app-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 36px; background: var(--sheet); border-radius: 18px; box-shadow: var(--shadow); }
.app-panel h3 { font: 700 34px/38px var(--display); letter-spacing: -0.015em; margin-bottom: 10px; }
.app-panel p { color: var(--ink-soft); }
.app-panel .actions { margin-top: 20px; }
.app-panel .mini { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.16)); }
.mini .lit { animation: minifade 5s var(--ease) 1.2s 1 both; }
@keyframes minifade { 0%, 12% { opacity: 1; } 100% { opacity: 0.12; } }
.bench { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 36px; border: 2px dashed var(--rule); border-radius: 18px; }
.bench h3 { font: 600 21px/28px var(--display); }
.bench p { color: var(--ink-soft); margin: 0; }
.bench a { margin-top: 8px; }

.ways { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.ways li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 32px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.ways h3 { font: 700 21px/28px var(--display); }
.ways p { margin: 0; color: var(--ink-soft); max-width: var(--measure); }

.story { max-width: var(--measure); }
.story p { font: 400 19px/31px var(--prose); }

.finder { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 32px; margin-top: 32px; }
.finder div { border-top: 1px solid var(--rule); padding-top: 16px; }
.finder strong { display: block; margin-bottom: 4px; }
.finder ul { list-style: none; padding: 0; margin: 8px 0 0; }
.finder li { margin-bottom: 4px; }


/* MARK: - Small screens */

@media (max-width: 1100px) {
  .feature { grid-template-columns: 1fr; gap: 24px; }
  .site-ruler { display: none; }
}
@media (max-width: 860px) {
  .display { font-size: 42px; line-height: 46px; }
  h1 { font-size: 36px; line-height: 42px; }
  h2 { font-size: 28px; line-height: 34px; }
  .loop { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .answers, .trust, .contact, .offer, .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .release { grid-template-columns: 1fr; gap: 8px; }
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--sheet); border-bottom: 1px solid var(--rule); padding: 8px 24px 16px; gap: 4px; }
  .menu-toggle { display: grid; }
  .hero-grid, .shelf, .app-panel { grid-template-columns: 1fr; }
  .hero-copy { padding-top: 24px; }
  .conker-hang { order: -1; width: 130px; margin: 0 auto 0 0; }
  .ways li { grid-template-columns: 1fr; gap: 6px; }
  .app-panel { padding: 24px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 56px; }
  .loop { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .release.new .body { animation: none; background-color: var(--accent-wash); }
  .conker-hang .swing.go { animation: none; }
}
