/* ============================================================
   Portfolio 2.0, site specific
   ------------------------------------------------------------
   Tokens and shared components now come from the design system:
   css/ds/tokens.css and css/ds/components.css, copied in by
   `npm run ds:sync`. Do not add a shared component here -- add it
   to portfolio-design-system and sync.

   What is left is what only this site has.
   ============================================================ */

/* ============================================================
   CHAT HOME
   The home page is the chat: a portrait band, then the chat column with
   the composer pinned. The <ask-nate> hook values here are Phase 2 work.
   ============================================================ */
/* Home = the chat. Nav, then a full-bleed portrait band, then the chat
   column with the composer pinned. */
.chat-home {
  height: calc(100dvh - var(--nav-h));
  margin-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Full-bleed portrait band: the image is the geometry (object-fit cover),
   the canvas paints the grain field over it and stays live. The source sits
   on #161616; a mask dissolves its edges into the page black. */
.chat-portrait {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: clamp(220px, 42vh, 440px);
  overflow: hidden;
}
/* The headline rides over the grain field, bottom left, and never blocks
   a click on the portrait. */
.chat-portrait__copy {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  z-index: 1;
  pointer-events: none;
}
.chat-portrait__title {
  font-size: clamp(64px, 10vw, 180px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.85;
  margin: 0;
}
.chat-portrait__eyebrow {
  margin-top: 16px;
  color: var(--grey-200);
}
.chat-portrait__img,
.chat-portrait__canvas {
  -webkit-mask-image: radial-gradient(ellipse 34% 100% at 50% 60%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 34% 100% at 50% 60%, #000 40%, transparent 100%);
}
.chat-portrait__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  opacity: 0.95;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}
.chat-portrait__canvas {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
/* Bar above the chat column: label left, Start over right. */
.chat-home__bar {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter) 0;
}
.chat-home__bar .eyebrow { color: var(--grey-400); }
.chat-home__reset {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--grey-800);
  color: var(--grey-200);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.chat-home__reset:hover { border-color: var(--grey-600); color: var(--white); }
.chat-home__reset span { font-size: 16px; line-height: 1; }
.chat-home ask-nate {
  width: 100%;
  max-width: 760px;
  flex: 1;
  min-height: 0;
  padding: 0 var(--gutter);
  /* The system themes the element (ds/ask-nate.css). The home chat differs in
     two ways: green marks the one place to act, the composer, and the type is
     a step larger because the chat is the whole page. */
  --ask-nate-accent: var(--action);
  --ask-nate-focus: var(--action);
  --ask-nate-font-size: var(--type-16);
  --ask-nate-font-size-intro: clamp(24px, 3.2vw, 36px);
}
.chat-home ask-nate::part(scroll) { padding-left: 0; padding-right: 0; padding-top: 20px; }
.chat-home ask-nate::part(intro-title) { letter-spacing: -0.02em; line-height: 1.15; max-width: 640px; }
.chat-home ask-nate::part(mark) { margin-bottom: 20px; }
.chat-home ask-nate::part(suggestions) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chat-home ask-nate::part(form) { padding-left: 0; padding-right: 0; border-top: 0; }
.chat-home ask-nate::part(input) {
  border: 1px solid var(--action);
  background: #0a0a0a;
  color: var(--white);
  min-height: 52px;
}
.chat-home ask-nate::part(input):focus { outline: 2px solid var(--action); outline-offset: -2px; }
.chat-home ask-nate::part(send) {
  width: 52px;
  background: var(--action);
  border-color: var(--action);
  color: var(--black);
}
.chat-home ask-nate::part(send):disabled { background: transparent; border-color: var(--action); color: var(--action); opacity: 0.7; }
@media (max-width: 768px) {
  .chat-portrait { height: clamp(220px, 36vh, 320px); }
  .chat-portrait__title { font-size: clamp(48px, 15vw, 96px); }
  .chat-portrait__eyebrow { margin-top: 12px; font-size: 11px; }
  .chat-portrait__img,
  .chat-portrait__canvas {
    -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 60%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 100% at 50% 60%, #000 40%, transparent 100%);
  }
  .chat-home ask-nate::part(suggestions) { grid-template-columns: 1fr; }
}

/* ============================================================
   ASK NATE DRAWER
   The chat surface is the <ask-nate> element (js/ask-nate.js); this is the
   drawer around it. Right panel on desktop, full screen on a phone, black
   with the site’s greys: the site is monochrome, so the accent is white.
   ============================================================ */
.ask-drawer { position: fixed; inset: 0; z-index: 200; }
.ask-drawer[hidden] { display: none; }
.ask-drawer__scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: ask-scrim-in 0.16s ease both;
}
.ask-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--black); color: var(--white);
  border-left: 1px solid var(--grey-800);
  animation: ask-panel-in 0.16s ease both;
}
.ask-drawer.is-closing .ask-drawer__scrim { animation: ask-scrim-in 0.16s ease reverse both; }
.ask-drawer.is-closing .ask-drawer__panel { animation: ask-panel-in 0.16s ease reverse both; }
.ask-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  height: 64px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--grey-800);
}
.ask-drawer__head .eyebrow { color: var(--grey-400); }
.ask-drawer__actions { display: flex; gap: 8px; }
.ask-drawer__btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--grey-800);
  color: var(--grey-400);
  font-size: 20px; line-height: 1;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.ask-drawer__btn:hover { color: var(--white); border-color: var(--grey-600); }
.ask-drawer__btn[hidden] { display: none; }
body.ask-open { overflow: hidden; }
body.ask-open main { filter: blur(12px); }
/* The drawer uses the system's element theme (ds/ask-nate.css) unchanged. */
.ask-drawer ask-nate { flex: 1; min-height: 0; }
/* Continue bar: a case-study page with a live thread offers to pick it up. */
.ask-continue {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex; align-items: stretch;
  border-top: 1px solid var(--grey-800);
  background: var(--black);
  color: var(--white);
  padding-bottom: env(safe-area-inset-bottom);
  animation: ask-bar-in 0.22s ease both;
}
.ask-continue[hidden] { display: none; }
.ask-continue__open {
  flex: 1;
  display: flex; align-items: center; gap: 16px;
  min-height: 56px;
  padding: 0 var(--gutter);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
}
.ask-continue__open:hover { color: var(--grey-200); }
.ask-continue__mark { color: var(--grey-400); white-space: pre; }
.ask-continue__dismiss {
  width: 56px;
  border-left: 1px solid var(--grey-800);
  color: var(--grey-400);
  font-size: 20px;
}
.ask-continue__dismiss:hover { color: var(--white); }
body.ask-continue-visible .footer { padding-bottom: 72px; }
@keyframes ask-bar-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ask-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ask-panel-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) {
  .ask-drawer__panel { width: 100%; border-left: 0; }
  .ask-drawer__head { height: var(--nav-h); padding-left: var(--gutter); padding-right: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  .ask-drawer__scrim, .ask-drawer__panel, .ask-continue { animation: none !important; }
  body.ask-open main { filter: none; }
}

/* ============================================================
   HISTORY: eras
   history.html is hidden and is not deployed. Nothing else uses these
   rules, so they are not part of the design system.
   ============================================================ */
.hero--text { min-height: auto; }
.hero--text .hero__meta { margin-bottom: 0; }
.era {
  padding-top: 96px;
  padding-bottom: 40px;
  border-top: 1px solid var(--grey-800);
}
.era__head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
}
.era__company { font-size: clamp(36px, 4vw, 56px); font-weight: 400; letter-spacing: -0.03em; line-height: 1; margin: 12px 0 10px; }
.era__role { font-size: 12px; color: var(--grey-400); letter-spacing: 0.08em; text-transform: uppercase; }
.era__summary { font-size: 18px; line-height: 1.5; color: var(--grey-200); max-width: 62ch; }
.gallery--era { padding-bottom: 24px; }
.era .accordion { margin-bottom: 40px; }
.acc__meta { grid-column: 2; font-size: 12px; color: var(--grey-400); letter-spacing: 0.06em; }
.era .acc__logo { font-size: 12px; font-weight: 400; letter-spacing: 0.08em; color: var(--grey-400); padding-right: 0; font-family: var(--font-mono); }
@media (max-width: 768px) {
  .era { padding-top: 64px; }
  .era__head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .acc__meta { display: none; }
  .era .acc__logo { display: none; }
}

/* Ten project cards on the home page (css/ds covers up to nine) */
.cards--10 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1360px) { .cards--10 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .cards--10 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .cards--10 { grid-template-columns: 1fr; } }

/* The Love Lights: live type tester set in the case study's own font */
@font-face {
  font-family: "The Love Lights";
  src: url("/assets/the-love-lights/TheLoveLights-Regular.woff2") format("woff2");
  font-display: swap;
}
.type-tester { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.type-tester__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.type-tester__size { display: flex; align-items: center; gap: 12px; margin-right: 12px; }
.type-tester__size input { width: 160px; accent-color: var(--accent); }
.type-tester__toggle {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.type-tester__toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.type-tester__toggle:hover { border-color: var(--accent-hover); }
.type-tester__toggle:focus-visible, .type-tester__text:focus-visible, .type-tester__size input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-tester__text {
  display: block; width: 100%; min-height: 280px; resize: vertical; border: 0; background: transparent; color: var(--accent);
  padding: 32px 24px; font-family: "The Love Lights", Impact, sans-serif; font-size: 120px; line-height: 1.05;
}
@media (max-width: 768px) { .type-tester__text { font-size: 64px; min-height: 200px; } .type-tester__size input { width: 120px; } }
