/* Agent Studio, "down the stack". Brand faces from the font store: IBM Plex Sans (display), DM Sans (text).
   The page reads the four layers top to bottom; each layer's ground is one step darker than the one above. */
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/display.ttf") format("truetype"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/text.ttf") format("truetype"); font-weight: 100 1000; font-display: swap; }

:root {
  --g4: #f7f8fa;           /* L4 and the top: the brand's light ground */
  --g3: #e8e6e2;           /* L3: the brand's story stone */
  --g2: #181818;           /* L2: charge */
  --g1: #080808;           /* L1: the site's stage black */
  --ink: #181818;
  --ink-2: #5e5e5e;        /* 6.4:1 on --g4, 5.2:1 on --g3 */
  --line: #dce1e6;
  --cream: #e8e6e2;
  --cream-2: #aaa8a5;      /* 7.5:1 on --g2, 8.6:1 on --g1 */
  --hair-dark: rgba(232, 230, 226, 0.16);
  --orange: #ff6b2b;
  --deep: #160a04;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "IBM Plex Sans";
  --text: "DM Sans";
  --pad: clamp(20px, 6vw, 72px);
  /* type scale, one step per role */
  --t-hero: clamp(48px, 10.4vw, 144px);
  --t-code: clamp(64px, 9vw, 136px);
  --t-h2: clamp(34px, 5.2vw, 72px);
  --t-say: clamp(19px, 1.9vw, 25px);
  --t-h3: clamp(21px, 2vw, 26px);
  --t-lede: clamp(19px, 1.8vw, 24px);
  --t-body: 17px;
  --t-small: 15px;
  --t-label: 13px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--g4); color: var(--ink); font: 400 var(--t-body)/1.55 var(--text); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ol { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.s2 :focus-visible, .s1 :focus-visible, .foot :focus-visible { outline-color: var(--cream); }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--g4); padding: 10px 14px; border-radius: 6px; z-index: 10; font-weight: 500; }
.skip:focus { top: 12px; }
.label { font: 500 var(--t-label)/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

/* Top: the name, the promise and the stack as a map of the page */
.bar { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.brand img { width: clamp(150px, 16vw, 210px); }
.bar-link { font: 500 15px/1 var(--text); text-decoration: none; padding: 10px 0; border-bottom: 1px solid rgba(24, 24, 24, 0.45); }
.bar-link:hover { border-bottom-color: var(--ink); }

.hero { display: grid; gap: clamp(40px, 6vw, 72px); padding-top: clamp(48px, 10vh, 120px); padding-bottom: clamp(56px, 9vw, 112px); }
.hero .label { margin-bottom: clamp(18px, 3vh, 28px); }
h1 { font: 600 var(--t-hero)/0.94 var(--display); letter-spacing: -0.035em; max-width: 8.4em; text-wrap: balance; }
.hero .lede { margin-top: clamp(28px, 4vw, 44px); font: 600 var(--t-h3)/1.25 var(--display); letter-spacing: -0.01em; }
.hero .aside { margin-top: 10px; max-width: 30em; color: var(--ink-2); }

.index ol { display: grid; }
.index a {
  display: flex; align-items: baseline; gap: 20px; padding: 20px 22px; min-height: 68px; text-decoration: none;
  font: 600 var(--t-h3)/1.1 var(--display); transition: transform 0.45s var(--ease);
}
.index .ic { font: 600 var(--t-label)/1 var(--display); letter-spacing: 0.1em; min-width: 2.4em; }
.i4 a { background: var(--g4); border: 1px solid var(--line); border-bottom: 0; }
.i3 a { background: var(--g3); }
.i2 a { background: var(--g2); color: var(--cream); }
.i1 a { background: var(--g1); color: var(--cream); }
.i2 .ic, .i1 .ic { color: var(--orange); }
.index a:hover { transform: translateX(10px); }
.i2 a:focus-visible, .i1 a:focus-visible { outline-color: var(--orange); }

/* A layer: its code and job on the left (held while you read), its proof on the right */
.layer { padding: clamp(72px, 11vw, 152px) 0; }
.s4 { background: var(--g4); border-top: 1px solid var(--line); }
.s3 { background: var(--g3); }
.s2 { background: var(--g2); color: var(--cream); }
.s1 { background: var(--g1); color: var(--cream); }

.layer-grid { display: grid; gap: 28px 0; }
.layer-head { position: relative; padding-top: 22px; }
.layer-head::before { content: ""; position: absolute; left: 0; top: 0; width: 48px; height: 6px; background: var(--orange); }
.code { font: 600 var(--t-code)/0.84 var(--display); letter-spacing: -0.04em; }
.s2 .code, .s1 .code { color: var(--orange); }
.name { margin-top: 14px; font: 600 var(--t-h3)/1.2 var(--display); }
.role { margin-top: 8px; max-width: 22em; font-size: var(--t-small); line-height: 1.5; color: var(--ink-2); }
.s2 .role, .s1 .role { color: var(--cream-2); }

.layer-body h2 { font: 600 var(--t-h2)/0.98 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.layer-body .body { margin-top: 20px; max-width: 32em; font-size: var(--t-lede); line-height: 1.45; color: var(--ink-2); }
.s2 .layer-body .body, .s1 .layer-body .body { color: var(--cream-2); }
.layer-body h3 { font: 600 var(--t-h3)/1.2 var(--display); }
.layer-body.after .body { margin-top: 10px; font-size: var(--t-body); }
.layer-body.after { padding-top: 24px; border-top: 1px solid rgba(24, 24, 24, 0.16); }

/* L4: what you type, as the studio's own chat bubbles; each line jumps to the layer that answers it */
.typed { margin-top: clamp(36px, 5vw, 56px); }
.typed ol { display: grid; gap: 12px; justify-items: end; }
.typed a {
  display: block; max-width: 30em; padding: 16px 22px; border-radius: 18px 18px 4px 18px; text-decoration: none;
  background: var(--ink); color: var(--cream); font: 500 var(--t-say)/1.35 var(--text);
  transition: background-color 0.3s var(--ease);
}
.typed a:hover { background: #2a2a2a; }
.typed figcaption { margin-top: 18px; text-align: right; font-size: var(--t-small); color: var(--ink-2); }

/* Pictures of the real studio */
.shot img, .versions img { border-radius: 10px; }
.shot img { box-shadow: 0 1px 0 rgba(24, 24, 24, 0.08), 0 24px 60px -28px rgba(24, 24, 24, 0.45); }
.s2 .shot img { box-shadow: none; outline: 1px solid var(--hair-dark); outline-offset: -1px; }
.found .strip { margin-top: 10px; border-radius: 8px; }
figcaption { font-size: var(--t-small); line-height: 1.5; }
.found figcaption, .versions figcaption { margin-top: 16px; color: var(--cream-2); max-width: 40em; }

/* L2: one exchange, word for word */
.exchange { margin-top: clamp(32px, 4vw, 48px); display: grid; gap: 18px; padding-top: 22px; border-top: 1px solid var(--hair-dark); }
.exchange p { display: grid; gap: 6px; font: 500 var(--t-say)/1.35 var(--text); }
.exchange .who { font: 500 var(--t-label)/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-2); }
.exchange .agent .who { color: var(--orange); }

/* L1: four versions of one title */
.versions ol { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.versions li span { display: block; margin-top: 8px; font: 500 var(--t-small)/1.3 var(--text); color: var(--cream); }

/* Close: the site's orange, the one action */
.close { background: var(--orange); color: var(--deep); padding: clamp(80px, 12vw, 160px) 0; }
.close .label { color: rgba(22, 10, 4, 0.86); }
.close h2 { margin-top: 18px; font: 600 var(--t-h2)/0.98 var(--display); letter-spacing: -0.03em; }
.close .lede { margin-top: 22px; max-width: 32em; font-size: var(--t-lede); line-height: 1.45; }
.close :focus-visible { outline-color: var(--deep); }
.notify { margin-top: clamp(32px, 4vw, 44px); max-width: 560px; }
.notify label { display: block; margin-bottom: 10px; font: 500 var(--t-label)/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.field { display: flex; gap: 8px; }
.notify input {
  flex: 1 1 auto; min-width: 0; height: 54px; padding: 0 16px; border-radius: 6px; border: 1px solid rgba(22, 10, 4, 0.4);
  background: #fff3e9; color: var(--deep); font: 400 17px/1 var(--text);
}
.notify input::placeholder { color: rgba(22, 10, 4, 0.62); }
.notify input:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
.notify input[aria-invalid="true"] { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); }
.notify button {
  flex: 0 0 auto; height: 54px; padding: 0 22px; border: 0; border-radius: 6px; background: var(--deep); color: #fff3e9;
  font: 600 16px/1 var(--text); cursor: pointer; transition: background-color 0.3s var(--ease);
}
.notify button:hover { background: #000; }
.notify button:focus-visible { outline: 2px solid var(--deep); outline-offset: 3px; }
.msg { min-height: 1.5em; margin-top: 12px; font-size: var(--t-small); font-weight: 500; }

.foot { background: var(--g1); color: var(--cream); padding: 36px 0 44px; }
.foot-body { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.foot img { width: 170px; }
.foot p { display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: var(--t-small); color: var(--cream-2); }
.foot a { color: var(--cream); text-decoration: none; border-bottom: 1px solid var(--hair-dark); padding-bottom: 2px; }
.foot a:hover { border-bottom-color: var(--cream); }

@media (min-width: 960px) {
  .hero { grid-template-columns: 7fr 5fr; align-items: end; }
  .layer-grid { grid-template-columns: minmax(240px, 3fr) 8fr; column-gap: clamp(40px, 5vw, 80px); row-gap: 56px; }
  .layer-head { grid-column: 1; grid-row: 1 / span 3; align-self: start; position: sticky; top: 40px; }
  .layer-body, .shot, .versions { grid-column: 2; }
  .versions ol { gap: 24px 16px; }
}
@media (max-width: 959px) {
  .layer-head { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; padding-bottom: 8px; }
  .name { margin-top: 0; align-self: end; padding-bottom: 0.1em; }
  .role { grid-column: 1 / -1; margin-top: 16px; }
  .typed a { max-width: 92%; margin-left: auto; padding: 14px 18px; }
  .typed ol { justify-items: stretch; }
}
@media (max-width: 480px) {
  .field { flex-direction: column; }
  .notify button { width: 100%; }
  .index a { padding: 18px; gap: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .index a:hover { transform: none; }
}
