/* ============================================================
   Kendall Dale — Build Log
   Aesthetic: workshop / build-log. Dark canvas, warm amber,
   mono accents, the work is the hero.
   ============================================================ */

:root {
  --bg: #0c0d10;
  --bg-2: #121317;
  --surface: #16181d;
  --surface-2: #1c1f26;
  --line: #2a2d36;
  --line-soft: #20232b;
  --text: #ecedf0;
  --text-dim: #9aa0ad;
  --text-faint: #646a78;
  --amber: #ffb340;
  --amber-soft: rgba(255, 179, 64, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 179, 64, 0.06), transparent 60%),
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: auto, 46px 46px, 46px 46px;
  background-position: 0 0, -1px -1px, -1px -1px;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(12px);
  background: rgba(12, 13, 16, 0.72);
  border-bottom: 1px solid var(--line-soft);
}
.nav__brand { display: flex; align-items: baseline; gap: 9px; }
.nav__mark {
  font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: 1px;
  border: 1.5px solid var(--amber); color: var(--amber);
  padding: 3px 7px; border-radius: 7px;
}
.nav__sub { font-family: var(--mono); font-size: 12px; color: var(--text-faint); letter-spacing: 1px; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 3vw, 30px); }
.nav__links a { font-size: 14px; color: var(--text-dim); transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  font-family: var(--mono); font-size: 13px; color: var(--bg) !important;
  background: var(--amber); padding: 8px 15px; border-radius: 8px; cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 179, 64, 0.25); }

/* ---------- Hero ---------- */
main { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.hero { padding: clamp(56px, 11vw, 130px) 0 clamp(40px, 7vw, 80px); }
.hero__eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hero__title {
  font-size: clamp(40px, 8.5vw, 88px); font-weight: 700; line-height: 1.02;
  letter-spacing: -0.03em; margin-bottom: 26px;
}
.hero__accent {
  color: var(--amber);
  background: linear-gradient(110deg, #ffb340, #ffd27a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__lede { max-width: 580px; font-size: clamp(16px, 2vw, 19px); color: var(--text-dim); margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 54px; }
.btn { font-size: 15px; font-weight: 500; padding: 13px 22px; border-radius: 10px; transition: transform .15s, background .2s, border-color .2s; }
.btn--primary { background: var(--amber); color: var(--bg); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 179, 64, 0.22); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); }

.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 60px); list-style: none; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats .stat__value { font-family: var(--mono); font-size: clamp(26px, 4vw, 38px); font-weight: 700; color: var(--text); }
.hero__stats .stat__label { font-size: 13px; color: var(--text-faint); font-family: var(--mono); margin-top: 2px; }

/* ---------- Section bits ---------- */
.section__title {
  font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px;
}
.section__title::before {
  content: ""; width: 26px; height: 2px; background: var(--amber); display: inline-block;
}
.section__title--sub { margin-bottom: 26px; color: var(--text); }

/* ---------- Product impact (track record) ---------- */
.track { padding-top: 8px; padding-bottom: 18px; }
.track__head { margin-bottom: 24px; }
.track__intro { max-width: 640px; margin-top: 13px; color: var(--text-dim); font-size: 15px; line-height: 1.6; }
.track__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cs {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 2px solid var(--card-accent);
  padding: 22px; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.cs:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(0,0,0,0.36); border-color: color-mix(in srgb, var(--card-accent) 45%, var(--line)); }
.cs__kind { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.cs__metric { display: flex; align-items: baseline; gap: 9px; margin: 14px 0 8px; flex-wrap: wrap; }
.cs__num { font-family: var(--mono); font-size: clamp(28px, 4vw, 36px); font-weight: 700; color: var(--card-accent); line-height: 1; letter-spacing: -.02em; }
.cs__mlabel { font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); }
.cs__name { font-size: 18px; font-weight: 600; margin-bottom: 8px; letter-spacing: -.01em; }
.cs__blurb { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; flex: 1; }
.cs__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.filters { padding-top: 30px; }
.filters__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.filters__bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 100px; padding: 7px 14px;
  transition: all .18s; background: var(--surface);
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip--active { background: var(--amber); color: var(--bg); border-color: var(--amber); font-weight: 500; }

/* ---------- Featured grid ---------- */
.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-bottom: 70px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .22s, border-color .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--card-accent) 55%, var(--line)); box-shadow: 0 18px 50px rgba(0,0,0,0.4); }
.card__shot {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background:
    radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--card-accent) 26%, transparent), transparent 55%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.card__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; opacity: 0; transition: opacity .5s; }
.card__shot img.loaded { opacity: 1; }
.card__glyph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: var(--card-accent); opacity: .55; z-index: 0;
}
.card__badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 7px; z-index: 2; }
.badge {
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 6px;
  background: rgba(12,13,16,0.7); backdrop-filter: blur(6px); border: 1px solid var(--line);
  color: var(--text-dim); letter-spacing: .3px;
}
.badge--status { color: var(--bg); font-weight: 500; }
.st-shipped { background: #4ade80; }
.st-working { background: #ffb340; }
.st-prototype { background: #c084fc; }
.st-spec { background: #64748b; color: #fff; }

.card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card__name { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.card__name .gl { color: var(--card-accent); font-size: 17px; }
.card__tagline { color: var(--card-accent); font-size: 14px; font-weight: 500; margin: 6px 0 12px; }
.card__blurb { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; margin-bottom: 16px; }
.card__hl { list-style: none; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.card__hl li { font-size: 13px; color: var(--text-faint); font-family: var(--mono); padding-left: 16px; position: relative; }
.card__hl li::before { content: "▹"; position: absolute; left: 0; color: var(--card-accent); }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; margin-bottom: 16px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--text-dim); border: 1px solid var(--line-soft); padding: 3px 8px; border-radius: 5px; }
.card__foot { display: flex; gap: 10px; }
.card__link {
  font-size: 13.5px; font-family: var(--mono); display: inline-flex; align-items: center; gap: 6px;
  color: var(--card-accent); border: 1px solid color-mix(in srgb, var(--card-accent) 40%, var(--line));
  padding: 9px 14px; border-radius: 9px; transition: all .18s;
}
.card__link:hover { background: color-mix(in srgb, var(--card-accent) 16%, transparent); }
.card__link--muted { color: var(--text-faint); border-color: var(--line); cursor: default; }
.card__ask { font-size: 13.5px; font-family: var(--mono); color: var(--text-dim); padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; transition: all .18s; }
.card__ask:hover { border-color: var(--text-faint); color: var(--text); }

/* ---------- Archive ---------- */
.archive { padding-bottom: 90px; }
.archive__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.acard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px; transition: transform .2s, border-color .2s; display: flex; flex-direction: column;
}
.acard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--card-accent) 50%, var(--line)); }
.acard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.acard__glyph { font-size: 22px; color: var(--card-accent); }
.acard__name { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.acard__tag { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; flex: 1; }
.acard__foot { display: flex; align-items: center; justify-content: space-between; }
.acard__link { font-family: var(--mono); font-size: 12.5px; color: var(--card-accent); }
.acard__link--muted { color: var(--text-faint); }
.acard__cat { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); margin-top: 20px; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 56px clamp(20px, 5vw, 56px) 30px;
  display: flex; flex-wrap: wrap; gap: 26px; align-items: center; justify-content: space-between;
}
.footer__big { font-size: clamp(24px, 4vw, 38px); font-weight: 600; letter-spacing: -0.02em; }
.footer__sub { color: var(--text-dim); margin-top: 6px; }
.footer__links { display: flex; gap: 12px; }
.footer__links a, .footer__sage {
  font-family: var(--mono); font-size: 14px; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--line); color: var(--text-dim); transition: all .18s;
}
.footer__sage { background: var(--amber); color: var(--bg); border-color: var(--amber); }
.footer__links a:hover { border-color: var(--text); color: var(--text); }
.footer__fine {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px) 40px;
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
}

/* ---------- Sage concierge ---------- */
.sage-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px;
  padding: 11px 18px 11px 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  transition: transform .18s, border-color .2s;
}
.sage-fab:hover { transform: translateY(-2px); border-color: var(--amber); }
.sage-fab__orb {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffe6b0, #ffb340 45%, #b8742a);
  box-shadow: 0 0 16px rgba(255,179,64,0.6); animation: float 3.4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.sage-fab__label { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }

.sage {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 48px));
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(20px) scale(.97); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.sage.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.sage__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sage__id { display: flex; align-items: center; gap: 12px; }
.sage__orb { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #ffe6b0, #ffb340 45%, #b8742a); box-shadow: 0 0 16px rgba(255,179,64,0.55); flex: none; }
.sage__name { font-size: 15px; font-weight: 600; }
.sage__status { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
.sage__close { font-size: 24px; color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px; line-height: 1; }
.sage__close:hover { background: var(--surface-2); color: var(--text); }

.sage__log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.sage__log::-webkit-scrollbar { width: 7px; }
.sage__log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.msg { max-width: 86%; font-size: 14px; line-height: 1.55; padding: 11px 14px; border-radius: 14px; }
.msg--sage { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg--user { align-self: flex-end; background: var(--amber); color: var(--bg); border-bottom-right-radius: 4px; font-weight: 500; }
.msg--sage a { color: var(--amber); text-decoration: underline; }
.msg b { color: var(--text); }
.msg--sage.typing { color: var(--text-faint); font-family: var(--mono); }
.typing span { animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }

.sage__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 12px; }
.sage__chip { font-family: var(--mono); font-size: 12px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 100px; padding: 6px 12px; transition: all .16s; }
.sage__chip:hover { border-color: var(--amber); color: var(--amber); }
.sage__form { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.sage__input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; color: var(--text); font-size: 14px; font-family: var(--sans); outline: none; transition: border-color .2s; }
.sage__input:focus { border-color: var(--amber); }
.sage__send { width: 42px; flex: none; background: var(--amber); color: var(--bg); border-radius: 11px; font-size: 18px; font-weight: 700; transition: transform .15s; }
.sage__send:hover { transform: translateY(-1px); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
  .archive__grid { grid-template-columns: 1fr 1fr; }
  .track__grid { grid-template-columns: 1fr; }
  .nav__links a:not(.nav__cta) { display: none; }
}
@media (max-width: 560px) {
  .archive__grid { grid-template-columns: 1fr; }
  .sage-fab__label { display: none; }
  .hero__stats { gap: 22px; }
}
