/* ==========================================================================
   loopwild.com
   Tokens follow kb/10-brand.md. Cobalt is the only accent on this page.
   One corner radius (--r) everywhere, including buttons. No pills.
   ========================================================================== */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens: light is master, dark swaps values ------------------------- */
:root {
  --paper: #ebeee8;
  --paper-2: #e2e6dd;
  --surface: #f4f6f1;
  --ink: #2a1006;          /* chocolate, the brand's second usable colour */
  --ink-soft: #6a5347;
  --line: rgba(42, 16, 6, 0.14);
  --line-strong: rgba(42, 16, 6, 0.28);
  --accent: #4474bb;
  --fill: #4474bb;         /* large cobalt surfaces */
  --fill-ink: #ffffff;     /* text on a cobalt fill */
  --accent-ink: #ffffff;
  --accent-soft: rgba(68, 116, 187, 0.1);
  --on-ink: #ebeee8;       /* text on a chocolate fill */

  --r: 16px;
  --shell: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0f120d;
    --paper-2: #161a13;
    --surface: #171b14;
    --ink: #ebeee8;
    --ink-soft: #9aa294;
    --line: rgba(235, 238, 232, 0.14);
    --line-strong: rgba(235, 238, 232, 0.3);
    --accent: #7195cc;
    --fill: #33528a;
    --fill-ink: #ebeee8;
    --accent-ink: #0f120d;
    --accent-soft: rgba(113, 149, 204, 0.14);
    --on-ink: #ebeee8;
  }
}

:root[data-theme='dark'] {
  --paper: #0f120d;
  --paper-2: #161a13;
  --surface: #171b14;
  --ink: #ebeee8;
  --ink-soft: #9aa294;
  --line: rgba(235, 238, 232, 0.14);
  --line-strong: rgba(235, 238, 232, 0.3);
  --accent: #7195cc;
  --fill: #33528a;
  --fill-ink: #ebeee8;
  --accent-ink: #0f120d;
  --accent-soft: rgba(113, 149, 204, 0.14);
  --on-ink: #ebeee8;
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 18px;
  border-radius: var(--r);
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 13px 22px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }

.btn--line { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--line:hover { border-color: var(--accent); color: var(--accent); }

.btn--onaccent { background: var(--fill-ink); color: var(--fill); }
.btn--onaccent:hover { opacity: 0.88; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}

/* --- Wordmark ----------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark__mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.wordmark__text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: lowercase;
}

/* --- Header ------------------------------------------------------------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
@media (prefers-reduced-transparency: reduce) {
  .site-head { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.site-head .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 16px;
}
/* :not(.btn) so the nav link colour never outranks the CTA's own contrast pair */
.nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav .btn { margin-left: 6px; padding: 10px 18px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon-sun { display: none; }
}

@media (max-width: 720px) {
  .nav__link--studio { display: none; }
  .nav .btn { display: none; }
}

/* --- Sections ----------------------------------------------------------- */
[id] { scroll-margin-top: 88px; }  /* clears the 68px sticky header */
.section { padding-block: clamp(72px, 11vw, 140px); }
.section--tight { padding-block: clamp(48px, 7vw, 84px); }
.section__title {
  font-size: clamp(30px, 4.4vw, 48px);
  max-width: 17ch;
}
.lead {
  color: var(--ink-soft);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 62ch;
}

/* --- Hero: asymmetric split -------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(56px, 8vw, 92px);
  padding-bottom: clamp(64px, 9vw, 112px);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 70px);
  max-width: 13ch;
}
.hero .lead { margin-top: 22px; }
.hero__actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(260px, 34vw, 430px);
}
.hero__art::before {
  content: '';
  position: absolute;
  inset: -8%;
  background: radial-gradient(circle at 52% 46%,
    color-mix(in srgb, var(--accent) 26%, transparent) 0%,
    transparent 62%);
  filter: blur(4px);
}
.hero__mark {
  position: relative;
  width: min(100%, 400px);
  height: auto;
  color: var(--accent);
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; min-height: 210px; }
  .hero__mark { width: min(62%, 260px); }
  .hero h1 { max-width: none; }
}

/* --- Platform strip ----------------------------------------------------- */
.platforms {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.platforms .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 48px);
  padding-block: clamp(30px, 4vw, 46px);
}
.platforms__label {
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.025em;
  max-width: 15ch;
  line-height: 1.2;
}
.platforms__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(22px, 3.6vw, 46px);
  color: var(--ink);
}
.platforms__logos li { display: flex; }
.platforms__logos svg {
  width: clamp(26px, 3vw, 32px);
  height: clamp(26px, 3vw, 32px);
  opacity: 0.5;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}
.platforms__logos li:hover svg { opacity: 1; color: var(--accent); }

/* --- Bento -------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: clamp(36px, 5vw, 56px);
}
.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  padding: clamp(26px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 200px;
}
.tile h3 { font-size: clamp(21px, 2.2vw, 27px); }
.tile p { font-size: 16px; line-height: 1.55; }

.tile--tall { grid-row: span 3; justify-content: space-between; min-height: 380px; }

.tile--accent {
  background: var(--fill);
  color: var(--fill-ink);
}
.tile--accent p { color: color-mix(in srgb, var(--fill-ink) 80%, var(--fill)); }
.tile--accent .tile__mark {
  width: clamp(120px, 22vw, 190px);
  height: auto;
  color: var(--fill-ink);
  opacity: 0.34;
}

.tile--ink {
  background: var(--ink);
  color: var(--on-ink);
}
.tile--ink { background: #2a1006; color: #ebeee8; }
:root[data-theme='dark'] .tile--ink { background: #3a1a0b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .tile--ink { background: #3a1a0b; }
}
.tile--ink p { color: rgba(235, 238, 232, 0.72); }

.tile--line {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.tile--line p { color: var(--ink-soft); }
.tile--dots::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 15px 15px;
  opacity: 0.5;
  mask-image: linear-gradient(200deg, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 62%);
  pointer-events: none;
}
.tile > * { position: relative; }

@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .tile--tall { grid-row: auto; min-height: 300px; }
}

/* --- Title project ------------------------------------------------------ */
.title-block { border-top: 1px solid var(--line); }
.title-block__head { max-width: 700px; }
.title-block .lead { margin-top: 22px; }

.specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(40px, 5vw, 64px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.specs > div {
  background: var(--surface);
  padding: clamp(20px, 2.4vw, 28px);
}
.specs dt {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.specs dd {
  margin: 0;
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.specs dd .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}
@media (max-width: 760px) {
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Studio: two column, sparse rules ---------------------------------- */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.practice li { padding-block: clamp(22px, 2.6vw, 30px); }
.practice li + li { border-top: 1px solid var(--line); }
.practice h3 {
  font-size: clamp(20px, 2vw, 24px);
  margin-bottom: 8px;
}
.practice p { color: var(--ink-soft); max-width: 56ch; }
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
}

/* --- Contact ------------------------------------------------------------ */
.contact {
  position: relative;
  overflow: hidden;
  background: var(--fill);
  color: var(--fill-ink);
  border-radius: var(--r);
  padding: clamp(40px, 6vw, 82px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.contact h2 { font-size: clamp(30px, 4.4vw, 50px); max-width: 15ch; }
.contact p {
  margin-top: 18px;
  max-width: 52ch;
  color: color-mix(in srgb, var(--fill-ink) 80%, var(--fill));
}
.contact__mark {
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 320px;
  color: var(--fill-ink);
  opacity: 0.12;
  pointer-events: none;
}
@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; }
  .contact__mark { width: 220px; right: -70px; bottom: -90px; }
}

/* --- Footer ------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 6vw, 72px) 32px;
  font-size: 15px;
}
.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(28px, 4vw, 56px);
}
.foot h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.foot__blurb { color: var(--ink-soft); max-width: 34ch; margin-top: 18px; }
.foot__links li + li { margin-top: 10px; }
.foot__links a { text-decoration: none; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.foot__links a:hover { color: var(--accent); }

.legal { color: var(--ink-soft); line-height: 1.65; }
.legal strong { color: var(--ink); font-weight: 500; }
.legal__ids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.legal__ids dt { font-size: 12px; opacity: 0.75; }
.legal__ids dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.legal__court { margin-top: 16px; font-size: 13.5px; }
.legal__mail { margin-top: 14px; }
.legal__mail a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.legal__mail a:hover { opacity: 0.75; }

.foot__base {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 14px;
}
@media (max-width: 900px) {
  .foot__grid { grid-template-columns: 1fr; }
  .legal__ids { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .legal__ids { grid-template-columns: 1fr 1fr; }
}

/* --- Motion: scroll reveal + loop draw ---------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: var(--d, 0ms);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  /* The mark is a loop closing on itself. Drawing it on load says the name. */
  .hero__mark .draw {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: draw-loop 1.5s var(--ease) 0.15s forwards;
  }
  .hero__mark .pop {
    opacity: 0;
    animation: pop-in 0.55s var(--ease) forwards;
  }
  .hero__mark .pop--a { animation-delay: 0.95s; }
  .hero__mark .pop--b { animation-delay: 1.05s; }
  .hero__mark .pop--c { animation-delay: 1.15s; }
  .hero__mark .pop--d { animation-delay: 1.3s; }
}

@keyframes draw-loop { to { stroke-dashoffset: 0; } }
@keyframes pop-in { from { opacity: 0; } to { opacity: 1; } }
