/* Cranium Studio. 60/30/10: black ground, white type and surfaces, royal blue accent. */
:root {
  --black: #000;
  --white: #fff;
  --blue: #2f5bea;
  --blue-press: #2149cc;
  --grey: #a1a1a6;      /* secondary text on black */
  --grey-dark: #55555b; /* secondary text on white */
  --line: rgba(255, 255, 255, 0.16);
  --pad: clamp(20px, 4.4vw, 64px);
  --max: 1360px;
  --head: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--blue); color: var(--white); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 16px; background: var(--white); color: var(--black);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Type */
.label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}
h1, h2 {
  font-family: var(--head);
  font-weight: 850;
  font-stretch: 118%;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(1.875rem, 1.6vw + 1.3rem, 3.25rem); }
h3 {
  font-family: var(--head);
  font-weight: 700;
  font-stretch: 100%;
  font-size: 1.375rem;
  line-height: 1.2;
}

/* Button: the one call to action */
.button {
  display: inline-flex; align-items: center; gap: 0.75em;
  min-height: 56px; padding: 0 28px;
  border-radius: 999px;
  background: var(--blue); color: var(--white);
  font-family: var(--head); font-weight: 650; font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}
.button:hover { background: var(--blue-press); }
.button:active { transform: scale(0.98); }
.button .arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.button:hover .arrow { transform: translateX(4px); }
.button-small { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }

/* Header: transparent with a soft shade once you scroll */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 32px;
  height: 76px; padding: 0 var(--pad);
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  opacity: 0; transition: opacity 0.3s ease;
}
.site-header.scrolled::before { opacity: 1; }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; margin-right: auto;
}
.brand-mark { width: 34px; height: auto; }
.brand-name {
  font-family: var(--head); font-weight: 800; font-stretch: 118%;
  text-transform: uppercase; font-size: 0.9375rem; letter-spacing: 0.01em;
}
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  font-size: 0.9375rem; font-weight: 500; color: var(--grey); text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--white); }
.site-nav { transition: transform 0.35s var(--ease); }
.site-header.cta-on .site-nav { transform: translateX(calc(-1 * var(--cta-w, 170px) - 28px)); }
.header-cta {
  position: absolute; right: var(--pad); top: 50%; margin-top: -21px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0s linear 0.25s, background-color 0.2s ease;
}
.header-cta.show {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0s, background-color 0.2s ease;
}

/* Sections share one column grid */
main > section { padding: 0 var(--pad); }
.hero, .work, .services > *, .contact { max-width: var(--max); margin-inline: auto; }

/* Hero */
.hero {
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 4vw, 72px);
  padding-top: 120px; padding-bottom: 72px;
}
.hero-label { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.dot { width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }
.hero-title { font-size: min(4.3vw, 4rem); }
.hero-title .line { white-space: nowrap; }
.line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.line > span { display: block; }
.lede { max-width: 34em; margin-top: 32px; font-size: clamp(1.0625rem, 0.3vw + 1rem, 1.25rem); color: #d4d4d8; }
.hero .button { margin-top: 36px; }
.hero-mark { justify-self: end; width: min(100%, 500px); }
.hero-mark img { width: 100%; will-change: transform; }

/* Section heads with a rule that draws across */
.section-head { position: relative; padding-top: 28px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head .label { margin-bottom: 18px; }
.rule {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--line); transform-origin: left;
}

/* Work */
.work { padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(88px, 10vw, 160px); }
.work-list { display: grid; gap: clamp(64px, 9vw, 136px); }
.project {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end; gap: 24px;
}
.frame {
  grid-column: 1 / span 8;
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: #0b0b0c;
}
.frame::after { /* a visible edge, since two of the sites have black backgrounds */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line); pointer-events: none;
}
.frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transform: scale(var(--zoom, 1)) translateY(var(--shift, 0));
}
.project-text { grid-column: 9 / span 4; padding-bottom: 6px; }
.project-text .label { display: block; margin-bottom: 14px; color: var(--blue); }
.project-text h3 { font-size: clamp(1.375rem, 1vw + 1rem, 2rem); font-stretch: 112%; font-weight: 800; }
.project-text p { margin-top: 8px; color: var(--grey); }
.project:nth-child(even) .frame { grid-column: 5 / span 8; grid-row: 1; }
.project:nth-child(even) .project-text { grid-column: 1 / span 4; grid-row: 1; }

/* Services: the white surface */
.services {
  background: var(--white); color: var(--black);
  border-radius: 28px 28px 0 0;
  padding-top: clamp(72px, 9vw, 136px);
  padding-bottom: clamp(88px, 10vw, 160px);
}
.services .rule { background: rgba(0, 0, 0, 0.14); }
.services .label { color: var(--grey-dark); }
.service-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); }
.service-list li { border-top: 2px solid var(--black); padding-top: 24px; }
.service-list .num {
  display: block; margin-bottom: 40px;
  font-family: var(--head); font-weight: 850; font-stretch: 118%; font-size: 1rem;
  color: var(--blue);
}
.service-list p { margin-top: 12px; color: #3a3a3f; max-width: 30em; }

/* Contact */
.contact {
  padding-top: clamp(104px, 13vw, 200px); padding-bottom: clamp(96px, 11vw, 168px);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.contact-title { font-size: clamp(2.25rem, 5.6vw, 5.5rem); }
.contact > p { margin-top: 24px; font-size: 1.1875rem; color: #d4d4d8; }
.contact .button { margin-top: 36px; }
.contact .contact-note { margin-top: 16px; font-size: 0.9375rem; color: var(--grey); }

/* Footer */
.site-footer {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px;
  max-width: var(--max); margin-inline: auto;
  padding: 28px var(--pad) 36px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem; color: var(--grey);
}
.footer-mark { width: 24px; opacity: 0.9; }
.site-footer p:last-child { margin-left: auto; user-select: all; }

/* Motion. Hidden states only exist when motion is allowed (html.motion). */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); transform: translateY(24px); } to { clip-path: inset(0 0 0 0); transform: none; } }

.motion .hero-title .line > span { animation: rise 0.9s var(--ease) both; }
.motion .hero-title .line:nth-child(2) > span { animation-delay: 0.08s; }
.motion .hero-title .line:nth-child(3) > span { animation-delay: 0.16s; }
.motion .hero-label, .motion .hero .fade { animation: fade-up 0.8s var(--ease) 0.35s both; }
.motion .hero .button.fade { animation-delay: 0.45s; }
.motion .hero-mark { animation: unveil 1.2s var(--ease) 0.1s both; }

.motion .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.9s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .service-list li:nth-child(2) { transition-delay: 0.08s; }
.motion .service-list li:nth-child(3) { transition-delay: 0.16s; }
.motion .rule { transform: scaleX(0); transition: transform 1.1s var(--ease); }
.motion .rule.in { transform: scaleX(1); }
.motion .reveal-wipe { clip-path: inset(12% 0 0 0 round 14px); opacity: 0.001; transition: clip-path 1.1s var(--ease), opacity 0.4s ease; }
.motion .reveal-wipe.in { clip-path: inset(0 0 0 0 round 14px); opacity: 1; }
.motion .frame img { --zoom: 1.08; }
.motion .reveal-lines .line > span { transform: translateY(105%); transition: transform 0.9s var(--ease); }
.motion .reveal-lines .line:nth-child(2) > span { transition-delay: 0.08s; }
.motion .reveal-lines.in .line > span { transform: none; }

/* Tablet and phone */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .hero {
    grid-template-columns: 1fr; gap: 0;
    min-height: 0; padding-top: 112px; padding-bottom: 24px;
  }
  .hero-title { font-size: min(8.1vw, 4.5rem); }
  .hero-mark { grid-row: 1; justify-self: start; width: clamp(120px, 34vw, 220px); margin-bottom: 36px; }
  .project { grid-template-columns: 1fr; gap: 20px; }
  .frame, .project-text,
  .project:nth-child(even) .frame, .project:nth-child(even) .project-text { grid-column: 1; grid-row: auto; }
  .project-text { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; }
  .project-text .label { grid-row: span 2; margin: 0; }
  .project-text p { margin-top: 2px; }
  .service-list { grid-template-columns: 1fr; gap: 48px; }
  .service-list .num { margin-bottom: 16px; }
  .services { border-radius: 20px 20px 0 0; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; gap: 12px; }
  .brand-mark { width: 28px; }
  .brand-name { font-size: 0.8125rem; }
  .button-small { min-height: 38px; padding: 0 14px; font-size: 0.875rem; }
  .header-cta { margin-top: -19px; }
  .button-small .arrow { display: none; }
  .hero .button, .contact .button { width: 100%; justify-content: center; }
  .site-footer p:last-child { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 404 */
.not-found { min-height: 100svh; justify-content: center; }
.not-found .label { margin-bottom: 24px; }
