/* ==========================================================================
   Placemark — static one-page site
   Concept: a pin dropped on a topographic map sheet.
   Palette: paper #EDF0EE · ink #0F1A2B · pin #E3402B · fog #C7CFCE
   Type: Bricolage Grotesque (display) · Instrument Sans (body) · JetBrains Mono (labels)
   ========================================================================== */

@font-face { font-family: "Bricolage Grotesque"; src: url("../assets/fonts/Bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../assets/fonts/InstrumentSans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #EDF0EE;
  --ink: #0F1A2B;
  --ink-2: #1B2A42;
  --pin: #E3402B;
  --fog: #C7CFCE;
  --mist: #DDE3E1;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 80rem;
  --gutter: 1.25rem;
  --p: 0; /* hero scroll progress 0..1, written by main.js */
}
@media (min-width: 768px) { :root { --gutter: 2rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pin); outline-offset: 4px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; font-variation-settings: "opsz" 96; }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.link { font-weight: 600; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s cubic-bezier(.2,.8,.2,1); }
.link:hover { background-size: 0 1.5px; background-position: 100% 100%; }

.cta { position: relative; display: inline-flex; align-items: center; gap: .6rem; padding: .95rem 1.5rem; border-radius: 999px; background: var(--pin); color: #fff; font-weight: 600; text-decoration: none; box-shadow: 0 0 0 0 rgba(227,64,43,.35), 0 14px 30px -14px rgba(227,64,43,.8); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(227,64,43,.14), 0 22px 36px -14px rgba(227,64,43,.9); }
.cta:active { transform: translateY(1px); }

/* ---------- nav ---------- */
.nav { position: fixed; inset-inline: 0; top: 0; z-index: 50; mix-blend-mode: difference; color: var(--paper); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-size: 1.15rem; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: none; gap: 1.75rem; font-size: .9rem; font-weight: 500; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.lang { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; border: 1px solid currentColor; border-radius: 999px; padding: .35rem .7rem; background: transparent; cursor: pointer; transition: background .2s, color .2s; }
.lang:hover { background: var(--paper); color: var(--ink); }

/* ---------- hero: scroll-scrubbed logo -> pin ---------- */
.hero { position: relative; height: 200vh; height: 200svh; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-rows: 1fr auto auto; align-items: center; padding: 6rem var(--gutter) 2.5rem; }
@media (min-width: 768px) { .hero-stage { padding-bottom: 3rem; } }

/* every animated node shares one paused 1s timeline scrubbed by --p */
.anim { animation-duration: 1s; animation-fill-mode: both; animation-timing-function: linear; animation-iteration-count: 1; animation-play-state: paused !important; animation-delay: calc(var(--p) * -1s); will-change: transform, opacity; }

.hero-bg { position: absolute; inset: -10% 0; z-index: 0; opacity: .8; color: var(--fog); animation-name: hs-bg; }
.hero-bg svg { width: 100%; height: 100%; }
.hero-grid { position: absolute; inset: 0; z-index: 0; opacity: 0; animation-name: hs-grid;
  background-image: linear-gradient(var(--fog) 1px, transparent 1px), linear-gradient(90deg, var(--fog) 1px, transparent 1px);
  background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 70%); }

.lockup { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 1.25rem; }
@media (min-width: 768px) { .lockup { gap: 2.25rem; } }
.markwrap { position: relative; flex: none; width: 96px; height: 96px; perspective: 800px; }
@media (min-width: 768px) { .markwrap { width: 168px; height: 168px; } }
.mark { position: absolute; inset: 0; transform-style: preserve-3d; animation-name: hs-mark; }
.face { position: absolute; inset: 0; width: 100%; height: 100%; }
.face-p { animation-name: hs-p; }
.face-pin { animation-name: hs-pin; opacity: 0; }
.dot { transform-box: fill-box; transform-origin: center; animation-name: hs-dot; }
.ring { position: absolute; left: 50%; bottom: -6px; width: 120px; height: 34px; margin-left: -60px; border-radius: 50%; border: 2px solid var(--pin); opacity: 0; animation-name: hs-ring; }
.ring-b { width: 200px; height: 56px; margin-left: -100px; animation-name: hs-ring-b; }

.hero-text { position: relative; display: grid; }
.word, .tag { grid-area: 1 / 1; font-size: clamp(2.6rem, 11vw, 7.5rem); white-space: nowrap; }
.word { animation-name: hs-word; }
.tag { white-space: normal; max-width: 12ch; font-size: clamp(1.9rem, 6.5vw, 4.6rem); line-height: 1; opacity: 0; animation-name: hs-tag; }

.hero-lead { position: relative; z-index: 1; margin-top: 2rem; max-width: 40rem; opacity: 0; animation-name: hs-lead; }
.hero-lead .mono { color: var(--pin); }
.hero-lead p + p { margin-top: .75rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); }
@media (min-width: 768px) { .hero-lead p + p { font-size: 1.25rem; } }
.ctas { display: flex; align-items: center; gap: 1.5rem; margin-top: 1.5rem; }
.hint { position: relative; z-index: 1; display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; color: rgba(15,26,43,.55); animation-name: hs-hint; }
.hint span { display: block; width: 40px; height: 1px; background: rgba(15,26,43,.35); }

/* Timeline, 0 -> 1 = first viewport height of scroll.
   The mark turns one full rotation linearly from 20% to 60%; it is edge-on (90deg) at exactly 30%,
   where the P silhouette swaps for the pin silhouette, so the change of shape is never seen head-on. */
@keyframes hs-mark { 0% { transform: rotateY(0deg) scale(1); } 20% { transform: rotateY(0deg) scale(1); animation-timing-function: linear; } 60% { transform: rotateY(360deg) scale(1.08); animation-timing-function: ease-out; } 100% { transform: rotateY(360deg) scale(1); } }
@keyframes hs-p { 0%, 29% { opacity: 1; } 31%, 100% { opacity: 0; } }
@keyframes hs-pin { 0%, 29% { opacity: 0; } 31%, 100% { opacity: 1; } }
@keyframes hs-dot { 0%, 26% { transform: translate(0, 0) scale(1); animation-timing-function: ease-in-out; } 34%, 100% { transform: translate(-2px, 1px) scale(1.64); } }
@keyframes hs-word { 0%, 14% { opacity: 1; transform: translateX(0); animation-timing-function: ease-in; } 34%, 100% { opacity: 0; transform: translateX(-40px); } }
@keyframes hs-tag { 0%, 44% { opacity: 0; transform: translateX(40px); animation-timing-function: ease-out; } 72%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes hs-ring { 0%, 62% { opacity: 0; transform: scale(.4); animation-timing-function: ease-out; } 70% { opacity: .9; } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes hs-ring-b { 0%, 68% { opacity: 0; transform: scale(.4); animation-timing-function: ease-out; } 76% { opacity: .6; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes hs-lead { 0%, 58% { opacity: 0; transform: translateY(28px); animation-timing-function: ease-out; } 86%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes hs-hint { 0% { opacity: 1; } 12%, 100% { opacity: 0; } }
@keyframes hs-bg { 0% { transform: translateY(0); } 100% { transform: translateY(-10%); } }
@keyframes hs-grid { 0%, 36% { opacity: 0; } 100% { opacity: .55; } }

/* ---------- sections ---------- */
.section { position: relative; overflow: hidden; padding-block: 6rem; }
@media (min-width: 768px) { .section { padding-block: 9rem; } }
.eyebrow { color: var(--pin); }
.h2 { margin-top: 1rem; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.contour { position: absolute; z-index: -1; pointer-events: none; color: var(--fog); }
.contour svg { width: 100%; height: 100%; }

/* about */
.about { z-index: 0; }
.about .contour { right: -10rem; top: 0; width: 900px; height: 700px; opacity: .7; }
.about-grid { display: grid; gap: 3rem; }
@media (min-width: 768px) { .about-grid { grid-template-columns: 5fr 1fr 6fr; gap: 2rem; } .about-grid > :last-child { grid-column: 3; } }
.prose { font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); }
.prose p + p { margin-top: 1.5rem; }
.ledger { position: relative; margin-top: 3rem; display: grid; gap: 1rem; border-block: 1px solid var(--fog); padding-block: 1.5rem; }
@media (min-width: 640px) { .ledger { grid-template-columns: 1fr 1fr; } }
.ledger dt { color: rgba(15,26,43,.6); }
.ledger dd { margin-top: .25rem; font-weight: 500; }
.ticks::before, .ticks::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--fog); border-style: solid; }
.ticks::before { left: 0; top: 0; border-width: 1px 0 0 1px; }
.ticks::after { right: 0; bottom: 0; border-width: 0 1px 1px 0; }

/* services */
.services { background: var(--ink); color: var(--paper); }
.services-head { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) { .services-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.services-note { max-width: 28rem; color: rgba(221,227,225,.8); }
.services-grid { margin-top: 3.5rem; display: grid; gap: 1px; border: 1px solid var(--ink-2); background: var(--ink-2); }
@media (min-width: 640px) { .services-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }
.service { display: flex; flex-direction: column; justify-content: space-between; min-height: 18rem; padding: 1.75rem; background: var(--ink); transition: background .5s; }
.service:hover { background: var(--ink-2); }
.service .mono { color: rgba(199,207,206,.6); }
.service h3 { font-size: 1.5rem; }
.service p { margin-top: .75rem; font-size: .9rem; line-height: 1.6; color: rgba(221,227,225,.75); }

/* work */
.work .contour { left: -13rem; bottom: 0; width: 900px; height: 600px; opacity: .6; }
.work-grid { margin-top: 3.5rem; display: grid; gap: 2rem; }
@media (min-width: 768px) { .work-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } .work-grid > :nth-child(2) { margin-top: 4rem; } }
.plate { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--mist); border: 1px solid var(--fog); }
.plate img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
figure:hover .plate img { transform: scale(1.04); }
figcaption { margin-top: 1rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
figcaption h3 { font-size: 1.25rem; }
figcaption p { margin-top: .25rem; font-size: .9rem; color: rgba(27,42,66,.8); }
.tagchip { flex: none; border: 1px solid var(--fog); padding: .25rem .5rem; color: rgba(15,26,43,.6); }
.work-more { margin-top: 3rem; color: rgba(15,26,43,.5); }

/* contact + footer */
.contact { border-top: 1px solid var(--fog); padding-bottom: 2.5rem; }
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 5fr 1fr 6fr; } .contact-grid > :last-child { grid-column: 3; } }
.contact-lead { margin-top: 1.5rem; max-width: 28rem; font-size: 1.125rem; color: var(--ink-2); }
.tiles { display: grid; gap: 1rem; }
.tile { display: block; position: relative; padding: 1.5rem 1.5rem 1.5rem 1.75rem; border: 1px solid var(--fog); background: #fff; color: var(--ink); text-decoration: none; transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent, var(--ink)); transition: width .3s; }
.tile:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 30px 40px -30px rgba(15,26,43,.35); }
.tile:hover::before { width: 9px; }
.tile .mono { color: rgba(15,26,43,.6); }
.tile .value { display: block; margin-top: .5rem; font-size: 1.5rem; }
.tile .sub { display: block; margin-top: .25rem; font-size: .9rem; color: rgba(27,42,66,.8); }
.tile[aria-disabled="true"] { opacity: .6; cursor: default; }
.tile[aria-disabled="true"]:hover { transform: none; box-shadow: none; border-color: var(--fog); }
.footer { margin-top: 6rem; display: grid; gap: 1.5rem; border-top: 1px solid var(--fog); padding-top: 2rem; font-size: .9rem; color: rgba(27,42,66,.8); }
@media (min-width: 768px) { .footer { grid-template-columns: repeat(3, 1fr); align-items: center; } .footer > :last-child { text-align: right; } }
.footer .brand { color: var(--ink); }
.footer .mono { color: rgba(15,26,43,.6); }

/* ---------- parallax layers ---------- */
[data-depth] { will-change: transform; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .plate img, .tile, .cta, .service { transition: none; }
  /* the hero is visitor-paced (scroll-scrubbed), so it stays; parallax is disabled in main.js */
}
