/* Crest Systems. The work leads and it moves: real tools play, real sites scroll inside their
   frames. One deep-green field carries the services; everything else is space, type and the work. */
@font-face {
  font-family: "Funnel Display";
  src: url("/fonts/funnel-display.woff2?v=1") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Sans";
  src: url("/fonts/funnel-sans.woff2?v=1") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
:root {
  --bg: #ffffff;
  --surface: #f2f5f3;
  --ink: #0e1512;
  --ink-2: #46514b;
  --ink-3: #5f6a64;
  --line: #e1e7e3;
  --green: #0b5d3b;
  --green-ink: #084a2f;
  --field: #0b2e22;
  --field-line: rgba(255, 255, 255, 0.14);
  --ok: #0b5d3b;
  --err: #a12b1f;
  --display: "Funnel Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Funnel Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 3.4vw, 48px);
  --radius: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
figure { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1400px; margin-inline: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -10000px; top: 8px; z-index: 10; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; }
.skip:focus { left: 8px; }

.link { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size 260ms ease; padding-bottom: 2px; }
.link:hover, .link[aria-current] { background-size: 100% 1.5px; }
.go { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; }
.go svg, .button svg { width: 16px; height: 16px; flex: none; transition: transform 220ms ease; }
.go:hover svg, .button:hover svg { transform: translateX(4px); }
.button { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; background: var(--green); color: #fff; text-decoration: none; border: 0; font: inherit; font-weight: 500; font-size: 17px; cursor: pointer; transition: background-color 200ms ease; }
.button:hover { background: var(--green-ink); }
.button:disabled { opacity: 0.6; cursor: wait; }

/* Header and footer */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-block: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 22px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; font-size: 16px; }
.nav .button { min-height: 42px; padding: 0 18px; font-size: 16px; }
footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 28px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Hero */
.hero { padding-block: clamp(56px, 9vw, 132px) clamp(40px, 6vw, 80px); }
.hero h1 { font-size: clamp(44px, 6.6vw, 104px); line-height: 0.98; letter-spacing: -0.04em; max-width: 13.5em; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; margin-top: clamp(28px, 4vw, 52px); }
.hero-foot p { max-width: 34em; font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

/* Frames: screenshots, walkthroughs and full-length site captures */
.frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px rgba(14, 21, 18, 0.08), 0 30px 60px -30px rgba(14, 21, 18, 0.35); }
.frame video, .frame > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.scroller { aspect-ratio: 16 / 10; }
.scroller img { width: 100%; height: auto; aspect-ratio: auto; object-fit: fill; transform: translateY(0); transition: transform 1.1s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.scroller.hover:hover img { transform: translateY(calc(var(--dist, 0px) * -1)); transition-duration: var(--hover-dur, 4s); transition-timing-function: cubic-bezier(.45, 0, .25, 1); }
.scroller.auto.playing img { animation: pan var(--pan-dur, 30s) ease-in-out infinite; }
@keyframes pan {
  0%, 8% { transform: translateY(0); }
  46%, 54% { transform: translateY(calc(var(--dist, 0px) * -1)); }
  92%, 100% { transform: translateY(0); }
}
.hint { position: absolute; right: 14px; bottom: 14px; padding: 7px 12px; border-radius: 999px; background: rgba(14, 21, 18, 0.78); color: #fff; font-size: 13px; line-height: 1; pointer-events: none; transition: opacity 300ms ease; }
.scroller.hover:hover .hint { opacity: 0; }
.scroller.auto .hint { display: none; }

/* Work */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(28px, 3.6vw, 48px); }
.section-head h2 { font-size: clamp(34px, 4vw, 60px); line-height: 1; letter-spacing: -0.035em; }
.section-head p { color: var(--ink-3); font-size: 17px; }
.work { padding-block: clamp(24px, 3vw, 40px) clamp(88px, 11vw, 160px); scroll-margin-top: 24px; }
.stage { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 24px; padding: clamp(18px, 3.4vw, 56px); border-radius: 28px; background: var(--surface); }
.stage .frame { grid-column: 1 / span 9; }
.phone { grid-column: 10 / span 3; justify-self: center; width: 100%; max-width: 330px; margin-left: -56px; padding: 9px; border-radius: 46px; background: var(--ink); box-shadow: 0 2px 4px rgba(14, 21, 18, 0.2), 0 40px 70px -28px rgba(14, 21, 18, 0.55); position: relative; z-index: 1; }
.phone .scroller { aspect-ratio: 390 / 844; border-radius: 38px; overflow: hidden; position: relative; background: #fff; }
.meta { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 24px; margin-top: 28px; align-items: baseline; }
.meta h3 { grid-column: 1 / span 4; font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -0.025em; line-height: 1.1; }
.meta .what { grid-column: 5 / span 5; display: flex; flex-direction: column; gap: 8px; }
.meta .what .note { color: var(--ink-3); font-size: 16px; }
.meta .links { grid-column: 10 / span 3; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 16px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 28px; margin-top: clamp(80px, 10vw, 140px); }
.pair.flush { margin-top: 0; }
.item { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.item-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: baseline; }
.item-text h3 { font-size: clamp(22px, 1.9vw, 28px); letter-spacing: -0.02em; line-height: 1.15; }
.item-text .kind { color: var(--ink-3); font-size: 15px; text-align: right; }
.item-text p { grid-column: 1 / -1; color: var(--ink-2); max-width: 36em; }
.item-text .go { grid-column: 1 / -1; justify-self: start; margin-top: 6px; font-size: 16px; }

/* Services */
.services { background: var(--field); color: #fff; padding-block: clamp(80px, 10vw, 140px); scroll-margin-top: 0; }
.services .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 24px; }
.services .intro { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 18px; }
.services h2 { font-size: clamp(34px, 4vw, 60px); line-height: 1; letter-spacing: -0.035em; }
.services .intro p { color: rgba(255, 255, 255, 0.78); max-width: 26em; }
.services .intro a { color: #fff; }
.svc-list { grid-column: 6 / span 7; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--field-line); }
.svc-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 32px; padding: 22px 0; border-bottom: 1px solid var(--field-line); transition: padding-left 260ms ease; }
.svc-list li:hover { padding-left: 10px; }
.svc-list b { font-family: var(--display); font-weight: 500; font-size: clamp(21px, 1.8vw, 26px); letter-spacing: -0.015em; }
.svc-list b a { text-decoration: none; }
.svc-list b a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.svc-list span { grid-column: 1; color: rgba(255, 255, 255, 0.72); font-size: 16px; }
.svc-list em { grid-row: 1; grid-column: 2; font-style: normal; font-family: var(--display); font-size: clamp(19px, 1.6vw, 22px); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Projects and games */
.products { padding-block: clamp(88px, 11vw, 160px) 0; }
.products .frame > img { transition: transform 700ms cubic-bezier(.2, .7, .2, 1); }
.products .item:hover .frame > img { transform: scale(1.03); }
.products .centered { object-position: center; }
.games { padding-block: clamp(88px, 11vw, 160px); }
.game-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.game { display: flex; flex-direction: column; gap: 14px; }
.game .frame { border-radius: 14px; transition: transform 300ms ease, box-shadow 300ms ease; }
.game:hover .frame { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(14, 21, 18, 0.08), 0 36px 60px -28px rgba(14, 21, 18, 0.45); }
.game .frame > img { object-position: center; }
.game h3 { font-size: 21px; letter-spacing: -0.015em; }
.game p { color: var(--ink-2); font-size: 16px; margin-top: 2px; }

/* About */
.about { border-top: 1px solid var(--line); padding-block: clamp(88px, 11vw, 160px); }
.about .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.about h2 { grid-column: 1 / span 4; font-size: clamp(34px, 4vw, 60px); line-height: 1; letter-spacing: -0.035em; }
.about .text { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 18px; max-width: 40em; }
.about p { color: var(--ink-2); font-size: clamp(18px, 1.4vw, 21px); }
.about .go { margin-top: 6px; font-size: 17px; }

/* Contact */
.contact { padding-block: 0 clamp(88px, 11vw, 140px); }
.contact .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 48px 24px; padding-top: clamp(64px, 8vw, 104px); border-top: 1px solid var(--line); }
.contact .text { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 20px; }
.contact h2 { font-size: clamp(40px, 5.4vw, 84px); line-height: 0.98; letter-spacing: -0.04em; }
.contact .text p { color: var(--ink-2); max-width: 26em; }
.contact .email { font-family: var(--display); font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.contact-box { grid-column: 7 / span 6; }
.contact-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea { font: inherit; font-size: 18px; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid transparent; border-radius: 12px; padding: 14px 16px; min-height: 52px; transition: border-color 200ms ease, background-color 200ms ease; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); background: #fff; }
.field [aria-invalid="true"] { border-color: var(--err); }
.contact-form .button { align-self: flex-start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 16px; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
.form-note { color: var(--ink-3); font-size: 15px; }

/* Detail pages: case studies, services, about and privacy */
.crumb { color: var(--ink-3); font-size: 16px; }
.detail-hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 24px; padding-block: clamp(48px, 7vw, 104px) clamp(36px, 5vw, 64px); }
.detail-hero .head { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 18px; }
.detail-hero h1 { font-size: clamp(38px, 5vw, 76px); line-height: 1; letter-spacing: -0.04em; }
.detail-hero .lede { grid-column: 8 / span 5; align-self: end; color: var(--ink-2); font-size: clamp(18px, 1.5vw, 21px); }
.detail-media { margin-bottom: clamp(56px, 7vw, 96px); scroll-margin-top: 24px; }
.detail-media figcaption { margin-top: 14px; color: var(--ink-3); font-size: 15px; }
.detail-media video { aspect-ratio: 16 / 10; background: var(--ink); }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.compare figcaption { margin-top: 12px; }
.detail-body { display: flex; flex-direction: column; padding-bottom: clamp(72px, 9vw, 128px); }
.detail-body section { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 24px; padding-block: 32px; border-top: 1px solid var(--line); }
.detail-body h2 { grid-column: 1 / span 4; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; line-height: 1.15; }
.detail-body .copy { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 14px; color: var(--ink-2); max-width: 40em; }
.detail-body .copy .go { color: var(--ink); }
.closing { background: var(--field); color: #fff; }
.closing .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding-block: clamp(56px, 7vw, 96px); }
.closing h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -0.03em; }
.closing p { color: rgba(255, 255, 255, 0.78); margin-top: 10px; }
.closing .button { background: #fff; color: var(--field); }
.closing .button:hover { background: #e6efe9; }

/* Arrival: sections rise into place as they scroll in, where the browser supports scroll timelines */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    @keyframes rise { from { opacity: 0.25; transform: translateY(48px); } to { opacity: 1; transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroller img, .link, .go svg, .button svg, .svc-list li, .game .frame, .products .frame > img { transition: none !important; animation: none !important; }
}

@media (max-width: 900px) {
  .stage .frame, .phone, .meta h3, .meta .what, .meta .links, .services .intro, .svc-list,
  .contact .text, .contact-box, .detail-hero .head, .detail-hero .lede, .detail-body h2, .detail-body .copy { grid-column: 1 / -1; }
  .phone { margin-left: 0; max-width: 280px; }
  .meta .links { justify-self: start; align-items: flex-start; }
  .pair, .compare { grid-template-columns: minmax(0, 1fr); }
  .game-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about h2, .about .text { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .nav a:not(.button) { display: none; }
  .game-row { grid-template-columns: minmax(0, 1fr); }
  .item-text { grid-template-columns: minmax(0, 1fr); }
  .item-text .kind { text-align: left; }
}
