/* KSTUDIO — site styles
   Palette and type come from the identity board: ivory / ink / stone / vermilion,
   Archivo used extra-wide for display and at normal width for text. */

:root {
  --ivory: #F2EEE6;
  --paper: #ECE6DB;
  --ink: #111111;
  --ink-2: #24211D;          /* closed service slices */
  --stone: #B9B2A6;
  --umber: #1B1713;          /* stone floor in the hero photo */
  --vermilion: #E8432A;
  --muted-ink: #5E5850;
  --muted-ivory: #A7A096;
  --hair-ink: rgba(17, 17, 17, .18);
  --hair-ivory: rgba(242, 238, 230, .22);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 3.6vw, 60px);
  --section-y: clamp(88px, 11vw, 168px);
  --max: 1600px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);          /* strong ease-out */
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);      /* on-screen morphs */
}

*,
*::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(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.sprite { position: absolute; }

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

/* ---------- Type ---------- */

.display {
  font-weight: 700;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  letter-spacing: -.035em;
  line-height: .92;
  text-wrap: balance;
}

.eyebrow {
  font-size: 15px;
  font-stretch: 110%;
  font-variation-settings: "wdth" 110;
  letter-spacing: .01em;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(22px, 3.4vw, 40px) var(--gutter) 0;
  max-width: var(--max); margin: 0 auto;
}

.brand { display: inline-flex; align-items: center; gap: clamp(18px, 2.6vw, 44px); color: var(--ink); }
.site-header .brand { color: var(--ivory); }   /* sits on the dark hero video */
.brand-mark { width: clamp(36px, 3.2vw, 52px); height: auto; aspect-ratio: 78 / 80; }
.brand-word {
  font-weight: 800;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  letter-spacing: .22em;
  font-size: clamp(13px, 1.25vw, 19px);
}

.site-nav { display: flex; gap: clamp(20px, 3.2vw, 52px); }
.site-nav a {
  color: var(--ivory);
  font-size: 17px;
  font-stretch: 108%;
  font-variation-settings: "wdth" 108;
  padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s var(--ease);
}

/* ---------- Buttons & links ---------- */

.btn-solid, .btn-ivory {
  display: inline-flex; align-items: center; gap: 1.4em;
  padding: 17px 28px 17px 32px; border-radius: 999px;
  font-size: 16.5px;
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.btn-solid { background: var(--ink); color: var(--ivory); }
.btn-ivory { background: var(--ivory); color: var(--ink); }
.btn-solid span, .btn-ivory span, .link-arrow span, .btn-ghost span { transition: transform .2s var(--ease); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 3.2em;
  padding: 16px 22px 16px 26px;
  border: 1px solid var(--ink); border-radius: 999px;
  font-size: 15.5px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}

.link-arrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
}

/* ---------- 00 Hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(620px, 100svh, 1040px);
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(56px, 7.5vw, 96px);
  background: var(--umber);
  color: var(--ivory);
}

.hero-media {
  position: absolute; inset: 0 0 auto; z-index: -2;
  width: 100%; height: 78%;
  object-fit: cover; object-position: 68% 50%;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

/* Fades the photo into the stone floor so the headline always sits on a dark ground. */
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 240px at 100% 0, rgba(27, 23, 19, .7), rgba(27, 23, 19, 0)),
    linear-gradient(180deg, rgba(27, 23, 19, 0) 34%, rgba(27, 23, 19, .55) 58%, var(--umber) 80%),
    radial-gradient(120% 70% at 85% 30%, rgba(27, 23, 19, 0), rgba(27, 23, 19, .25));
}

.hero-copy { width: min(100%, 1240px); }

.hero-title { font-size: clamp(46px, 6.4vw, 112px); max-width: 13ch; }

.hero-lede {
  margin-top: clamp(20px, 2.4vw, 34px);
  max-width: 52ch;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.4;
  font-stretch: 108%;
  font-variation-settings: "wdth" 108;
  text-wrap: pretty;
}

.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 36px;
  margin-top: clamp(28px, 3vw, 44px);
}

.hero-index {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 7.5vw, 96px);
  font-size: 14px; color: var(--muted-ivory);
}

/* Load-in: copy rises once from a visible resting state. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .9s var(--ease) both; }
  .hero-lede { animation-delay: .08s !important; }
  .hero-actions { animation-delay: .16s !important; }
}
@keyframes rise { from { transform: translateY(18px); opacity: .001; } }

/* ---------- 01 Cases ---------- */

.work {
  max-width: var(--max); margin: 0 auto;
  padding: var(--section-y) var(--gutter);
  background: var(--ivory);
}

.work-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.work-title { margin-top: 14px; font-size: clamp(40px, 4.8vw, 84px); max-width: 16ch; }
.work-lede { margin-top: clamp(20px, 2vw, 28px); max-width: 56ch; font-size: 17px; color: var(--muted-ink); }
.work-mark { width: clamp(34px, 2.8vw, 46px); height: auto; aspect-ratio: 78 / 80; flex: none; }

/* Staggered columns: offsets follow the approved comp (0 / 7 / 14 / 4 % of the row). */
.work-grid {
  --step: clamp(28px, 7vw, 120px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.6vw, 42px);
  margin-top: clamp(44px, 5vw, 76px);
  align-items: start;
}
.case:nth-child(2) { margin-top: var(--step); }
.case:nth-child(3) { margin-top: calc(var(--step) * 2); }
.case:nth-child(4) { margin-top: calc(var(--step) * .6); }

/* Each case is a typographic plate in one of the brand surfaces. */
.case-plate {
  aspect-ratio: 1; max-width: 100%;
  display: flex; flex-direction: column;
  padding: clamp(16px, 1.6vw, 26px);
  transition: transform .25s var(--ease);
}
.case--ink .case-plate { background: var(--ink); color: var(--ivory); }
.case--stone .case-plate { background: var(--stone); color: var(--ink); }
.case--paper .case-plate { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-ink); }
.case--verm .case-plate { background: var(--vermilion); color: var(--ivory); }

.case-cat { font-size: 14px; opacity: .72; }
.case-name {
  margin-top: auto;
  font-weight: 700; font-stretch: 125%; font-variation-settings: "wdth" 125;
  font-size: clamp(24px, 2.5vw, 42px); line-height: .95; letter-spacing: -.035em;
}
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: clamp(14px, 1.4vw, 22px); }
.case-tags li { font-size: 12px; padding: 4px 9px; border-radius: 99px; box-shadow: inset 0 0 0 1px currentColor; opacity: .8; }

.case-meta {
  display: grid; gap: 8px; margin-top: 18px;
  font-size: 15px; line-height: 1.4;
}
.case-meta span + span { color: var(--muted-ink); font-size: 14px; }
.case-meta a { border-bottom: 1px solid var(--hair-ink); }

.work-foot { display: flex; justify-content: flex-end; margin-top: clamp(40px, 4vw, 64px); }

/* ---------- 02 Process ---------- */

.approach {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--section-y) * 1.1) var(--gutter);
  background: var(--ink);
  color: var(--ivory);
}

.approach-title { margin-top: clamp(28px, 3vw, 44px); font-size: clamp(40px, 5.2vw, 88px); }

.steps {
  width: min(100%, 560px);
  margin-top: clamp(48px, 5vw, 72px);
  text-align: left;
}
.steps li {
  display: grid; grid-template-columns: 64px 1fr; align-items: baseline;
  padding-block: 22px;
}
.steps li + li { border-top: 1px solid var(--hair-ivory); }
.step-n { font-size: 19px; color: var(--muted-ivory); font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 19px; font-weight: 500; }
.steps p { margin-top: 4px; font-size: 15.5px; color: var(--muted-ivory); }

.terms {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 900px);
  margin-top: clamp(48px, 5vw, 80px);
  text-align: left;
}
.terms div { padding: 18px 20px 0 0; border-top: 1px solid var(--hair-ivory); }
.terms dt { font-size: 13px; color: var(--muted-ivory); }
.terms dd { margin-top: 6px; font-size: 18px; font-weight: 500; }

/* The brand's folded corner, at the same 45° as the mark. */
.approach-corner {
  position: absolute; right: 0; bottom: 0; z-index: -1;
  width: clamp(160px, 22vw, 400px); aspect-ratio: 1;
  background: var(--vermilion);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* ---------- 03 Services ---------- */

.services {
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(36px, 3.4vw, 56px) var(--gutter);
  background: var(--paper);
}

/* Accordion: one wide open slice, three narrow ones. Width animates through flex-grow. */
.slices { display: flex; gap: 10px; height: clamp(500px, 48vw, 760px); }
.slice {
  position: relative; overflow: hidden;
  flex: 1 1 0; min-width: 0;
  background: var(--ink-2); color: var(--ivory);
  transition: flex-grow .45s var(--ease-io), background-color .2s ease;
}
.slice.is-open { flex-grow: 3.4; background: var(--ink); }

.slice-tab {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: clamp(18px, 2vw, 30px);
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.slice-tab:focus-visible { outline-offset: -6px; }
.slice-name {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: clamp(22px, 2.1vw, 34px); font-weight: 500;
  font-stretch: 108%; font-variation-settings: "wdth" 108;
  letter-spacing: -.01em; line-height: 1; white-space: nowrap;
}
.slice-plus { position: relative; width: 22px; height: 22px; }
.slice-plus::before, .slice-plus::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px; margin-top: -.75px;
  background: currentColor; transition: transform .25s var(--ease);
}
.slice-plus::after { transform: rotate(90deg); }
.slice.is-open .slice-plus::after { transform: rotate(0deg); }
.slice.is-open .slice-plus { color: var(--vermilion); }

.slice-body {
  position: absolute; z-index: 2;
  left: clamp(72px, 6vw, 100px); bottom: clamp(18px, 2vw, 30px);
  width: min(36ch, calc(100% - clamp(90px, 8vw, 130px)));
  font-size: 16px; line-height: 1.45;
  opacity: 0; transform: translateY(8px); visibility: hidden;
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s .4s;
}
.slice.is-open .slice-body { opacity: 1; transform: none; visibility: visible; transition-delay: .25s, .25s, 0s; }
.slice-body ul { margin-top: 18px; border-top: 1px solid var(--hair-ivory); }
.slice-body li { display: flex; gap: 12px; padding-block: 8px; font-size: 14.5px; color: var(--muted-ivory); border-bottom: 1px solid var(--hair-ivory); }
.slice-body li::before { content: "→"; color: var(--vermilion); }

.services-title { margin-top: clamp(28px, 3vw, 48px); font-size: clamp(34px, 3.4vw, 60px); }
.services-lede { margin-top: clamp(24px, 2.6vw, 40px); max-width: 36ch; font-size: 17px; line-height: 1.5; color: var(--muted-ink); }
.services-copy .btn-solid { margin-top: clamp(32px, 3.4vw, 52px); }

/* ---------- 04 Studio ---------- */

.clients {
  display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr);
  background: var(--ivory);
}
.clients-copy { padding: var(--section-y) var(--gutter); display: flex; flex-direction: column; }

.studio-title {
  margin-top: clamp(32px, 4vw, 60px); max-width: 18ch;
  font-size: clamp(34px, 3.8vw, 66px); font-weight: 600;
  font-stretch: 108%; font-variation-settings: "wdth" 108;
  letter-spacing: -.035em; line-height: 1.02; text-wrap: balance;
}
.studio-text { margin-top: clamp(24px, 2.4vw, 36px); max-width: 54ch; font-size: 17px; color: var(--muted-ink); text-wrap: pretty; }

.principles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 48px);
  margin-top: clamp(48px, 5vw, 80px); max-width: 760px;
}
.principles li { padding-block: 18px; border-top: 1px solid var(--hair-ink); }
.principles h3 { display: flex; align-items: center; gap: 14px; font-size: 17px; font-weight: 600; }
.principles h3::before { content: ""; width: 20px; height: 2px; background: var(--vermilion); flex: none; }
.principles p { margin-top: 6px; font-size: 15px; color: var(--muted-ink); }

.stack {
  position: relative;
  padding: var(--section-y) var(--gutter);
  background: var(--ink); color: var(--ivory);
}
.stack-title {
  font-weight: 700; font-stretch: 125%; font-variation-settings: "wdth" 125;
  font-size: clamp(32px, 3.2vw, 54px); letter-spacing: -.035em; line-height: 1;
}
.stack-lede { margin-top: 16px; max-width: 34ch; font-size: 16px; color: var(--muted-ivory); }
.stack-list { margin-top: clamp(36px, 4vw, 60px); }
.stack-list div { padding-block: 16px; border-top: 1px solid var(--hair-ivory); }
.stack-list dt { font-size: 13px; color: var(--muted-ivory); }
.stack-list dd { margin-top: 6px; font-size: 17px; line-height: 1.45; }
.stack-mark { position: absolute; right: var(--gutter); top: var(--section-y); width: 34px; height: auto; aspect-ratio: 78 / 80; }

/* ---------- 05 Contact ---------- */

.cta {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(120px, 13vw, 200px) var(--gutter);
  background: var(--vermilion); color: var(--ivory);
}
/* paper grain */
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .12  0 0 0 0 .05  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.cta-title { font-size: clamp(54px, 8.4vw, 148px); }
.cta-lede { margin-top: clamp(24px, 2.6vw, 36px); max-width: 40ch; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.4; text-wrap: balance; }
.cta .btn-ivory { margin-top: clamp(32px, 3.2vw, 48px); font-size: 18px; padding: 20px 32px 20px 40px; }
.cta-contacts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px;
  margin-top: clamp(32px, 3.2vw, 48px); font-size: 16px;
}
.cta-contacts a { border-bottom: 1px solid rgba(242, 238, 230, .5); }
.cta-contacts span { opacity: .8; }

/* ---------- Footer ---------- */

.site-footer {
  display: grid; grid-template-columns: 1.6fr 1.4fr auto; align-items: start;
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(56px, 6vw, 88px) var(--gutter);
  background: var(--ink); color: var(--ivory);
}
.footer-brand { display: inline-flex; align-items: center; gap: clamp(20px, 2.4vw, 36px); }
.footer-brand .brand-mark { width: clamp(48px, 4.6vw, 72px); }
.footer-brand .brand-word { font-size: clamp(18px, 1.8vw, 28px); font-weight: 600; letter-spacing: .26em; }
.footer-tag { margin-top: 20px; font-size: 14px; color: var(--muted-ivory); }

.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.footer-cols div { display: grid; gap: 10px; align-content: start; }
.footer-cols h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-ivory); }
.footer-cols a { font-size: 16px; width: fit-content; }
.footer-copy { font-size: 14px; color: var(--muted-ivory); }


/* ---------- Hover (pointer devices only) & press ---------- */

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background-size: 100% 1px; }
  .btn-solid:hover, .btn-ivory:hover { transform: translateY(-2px); }
  .btn-solid:hover span, .btn-ivory:hover span, .link-arrow:hover span, .btn-ghost:hover span { transform: translateX(4px); }
  .btn-ghost:hover { background: var(--ink); color: var(--ivory); }
  .case:hover .case-plate { transform: translateY(-4px); }
  .case-meta a:hover { border-color: currentColor; }
  .slice:not(.is-open):hover { background: #2E2A25; }
  .cta-contacts a:hover { border-color: currentColor; }
  .footer-cols a:hover { color: var(--vermilion); }
}

.btn-solid:active, .btn-ivory:active, .btn-ghost:active { transform: scale(0.97); transition-duration: .16s; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .services { grid-template-columns: minmax(0, 1fr); }
  .services-copy { order: -1; padding-top: var(--section-y); }
  .site-footer { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); --step: 64px; }
  .case:nth-child(3) { margin-top: 0; }
  .case:nth-child(4) { margin-top: var(--step); }
  .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .clients { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 14px; }
  .site-nav a[href="#studio"] { display: none; }
  .brand-word { display: none; }
  .hero { min-height: 0; padding-top: 92vw; }
  .hero-media { height: 112vw; object-position: 72% 50%; }
  .hero-shade { background: linear-gradient(180deg, rgba(27, 23, 19, .55), rgba(27, 23, 19, 0) 120px); }
  .hero-index { display: none; }

  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .case:nth-child(n) { margin-top: 0; }
  .case:nth-child(even) { width: 86%; justify-self: end; }
  .case-plate { aspect-ratio: 4 / 3; }
  .work-foot { justify-content: flex-start; }

  .steps li { grid-template-columns: 48px 1fr; }

  /* Services become a vertical accordion; the open slice shows its content below the tab. */
  .slices { flex-direction: column; height: auto; gap: 8px; }
  .slice { flex: none; }
  .slice-tab { position: relative; flex-direction: row; align-items: center; padding: 0 20px; height: 72px; width: 100%; }
  .slice-name { writing-mode: horizontal-tb; transform: none; font-size: 22px; }
  .slice-body { position: static; width: auto; padding: 0 20px 22px; display: none; }
  .slice.is-open .slice-body { display: block; }

  .principles { grid-template-columns: minmax(0, 1fr); }
  .footer-cols { grid-template-columns: minmax(0, 1fr); }
  .footer-brand .brand-word { display: inline; }
}
