/* ============================================================
   Sawir Studio — design tokens
   Palette: cool "system" canvas + deep ink + one amber signal.
   Type:    IBM Plex Mono (display/system voice) + Space Grotesk (body).
   ============================================================ */
:root {
  --paper:      #e8ebec;
  --paper-2:    #dde2e3;
  --panel:      #e1e6e7;
  --ink:        #0f1416;
  --slate:      #5c646b;
  --slate-2:    #828b92;
  --rule:       #c8ced2;
  --rule-soft:  #d4dadD;
  --chip:       #f4f6f6;

  --amber:      #e8920a;   /* the single "live" signal */
  --amber-deep: #b96f06;
  --amber-tint: rgba(232, 146, 10, 0.12);

  --font-display: "IBM Plex Mono", ui-monospace, monospace;
  --font-body: "Space Grotesk", system-ui, sans-serif;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(72px, 11vw, 150px);
  --radius: 4px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 100; font-family: var(--font-display); font-size: 14px;
}
.skip:focus { left: 12px; top: 12px; }

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

/* layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* shared type */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 22px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow__mark {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 var(--amber-tint);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,146,10,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(232,146,10,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,146,10,0); }
}

.section-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
  margin: 0 0 56px;
  max-width: 22ch;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav {
  display: flex; align-items: center; gap: 24px;
  min-height: 68px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; font-family: var(--font-display);
  font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em;
}
.wordmark__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-tint);
}
.wordmark__name { color: var(--ink); }
.wordmark__studio { color: var(--slate-2); font-weight: 400; margin-left: 1px; }

.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a {
  text-decoration: none; font-size: 0.95rem; color: var(--slate);
  font-weight: 500; transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); }

.nav__cta { margin-left: 8px; }

/* buttons */
.btn {
  --btn-bg: var(--amber);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.86rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 12px 20px; border-radius: var(--radius);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
              border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn--primary { background: var(--amber); color: var(--ink); }
.btn--primary:hover { background: var(--amber-deep); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { border-color: var(--ink); background: var(--chip); }
.btn--lg { padding: 16px 28px; font-size: 0.92rem; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 9vw, 110px);
  overflow: hidden;
}
/* faint blueprint dot grid — ties to the node-graph thesis */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--ink) 0.9px, transparent 0.9px);
  background-size: 26px 26px;
  opacity: 0.035;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
}
.display__accent { color: var(--amber); }
.lede {
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  color: var(--slate);
  max-width: 46ch;
  margin: 0 0 38px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* graph */
.hero__graph { position: relative; }
.graph {
  background: linear-gradient(180deg, var(--chip), color-mix(in srgb, var(--paper) 60%, transparent));
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -28px rgba(15,20,22,0.4);
}
.graph svg { width: 100%; height: auto; display: block; }

.graph__status {
  margin: 14px 0 0; padding: 0 4px;
  font-family: var(--font-display); font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate);
  display: inline-flex; align-items: center; gap: 9px;
}
.graph__pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate-2);
  transition: background 0.4s var(--ease);
}
.graph[data-status="running"] .graph__pulse { background: var(--amber); animation: pulse 2.6s var(--ease) infinite; }

/* SVG node-graph styling */
.g-edge {
  stroke: var(--rule); stroke-width: 1.4; fill: none;
  transition: stroke 0.3s var(--ease), opacity 0.3s var(--ease);
}
.g-node rect {
  fill: var(--chip); stroke: var(--rule); stroke-width: 1.2;
  transition: stroke 0.25s var(--ease), fill 0.25s var(--ease);
}
.g-node text {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  fill: var(--ink); user-select: none;
}
.graph.is-focusing .g-node:not(.is-active),
.graph.is-focusing .g-edge:not(.is-active) { opacity: 0.18; }
.g-node.is-active rect { stroke: var(--amber); fill: var(--amber-tint); }
.g-edge.is-active { stroke: var(--amber); stroke-width: 1.8; }
.g-node.is-live rect { stroke: var(--amber); }
.g-edge.is-live { stroke: var(--amber); opacity: 0.85; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding-block: var(--section-y); }
.section--panel { background: var(--panel); border-block: 1px solid var(--rule-soft); }

/* mess list */
.mess-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.mess-list__item {
  display: grid; grid-template-columns: 64px 1fr; gap: 24px;
  align-items: baseline;
  padding: 30px 0;
  border-top: 1px solid var(--rule);
}
.mess-list__item:last-child { border-bottom: 1px solid var(--rule); }
.mess-list__tag {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 500;
  color: var(--amber); letter-spacing: 0.04em;
}
.mess-list__item p {
  margin: 0; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.4;
  font-weight: 500; letter-spacing: -0.012em; max-width: 32ch;
}

/* process */
.process {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: 8px; overflow: hidden;
}
.process__step { background: var(--panel); padding: 34px 28px 38px; position: relative; }
.process__num {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 500;
  color: var(--amber); letter-spacing: 0.06em;
}
.process__h {
  font-family: var(--font-body); font-weight: 600; font-size: 1.35rem;
  margin: 16px 0 10px; letter-spacing: -0.015em;
}
.process__p { margin: 0; color: var(--slate); font-size: 0.98rem; line-height: 1.55; }

/* capabilities */
.capabilities {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--rule-soft); border: 1px solid var(--rule-soft);
  border-radius: 8px; overflow: hidden;
}
.cap { background: var(--paper); padding: 32px 30px; }
.cap__h {
  font-family: var(--font-body); font-weight: 600; font-size: 1.18rem;
  margin: 0 0 8px; letter-spacing: -0.012em;
  display: flex; align-items: center; gap: 10px;
}
.cap__h::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); flex: none;
}
.cap__p { margin: 0; color: var(--slate); font-size: 0.98rem; line-height: 1.55; }

/* outcomes */
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.outcome__big {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 14px;
  letter-spacing: -0.02em; color: var(--ink);
}
.outcome__p { margin: 0; color: var(--slate); font-size: 1.02rem; line-height: 1.55; max-width: 30ch; }
.outcome { padding-top: 22px; border-top: 2px solid var(--amber); }

/* ============================================================
   Work / case studies
   ============================================================ */
.work-list { border-top: 1px solid var(--rule); margin-top: 8px; }
.work-item {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(30px, 4vw, 46px) 0;
  border-bottom: 1px solid var(--rule);
}
.work-item__shot {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--chip);
  box-shadow: 0 16px 34px -26px rgba(15, 20, 22, 0.55);
}
.work-item__shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s var(--ease);
}
a.work-item__shot:hover img { transform: scale(1.03); }
.work-item__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  margin: 0 0 10px;
}
.work-item__domain {
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}
.work-item__domain:hover { color: var(--amber); }
.work-item__tag {
  font-family: var(--font-display); font-weight: 500; font-size: 0.74rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-2);
}
.work-item__title {
  font-family: var(--font-body); font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin: 0 0 14px; letter-spacing: -0.018em;
}
.work-item__sub { font-weight: 400; color: var(--slate); font-size: 0.62em; }
.work-item__desc {
  margin: 0 0 20px; max-width: 58ch; color: var(--slate);
  font-size: 1.02rem; line-height: 1.6;
}
.work-item__built {
  margin: 0; font-family: var(--font-display); font-size: 0.85rem;
  color: var(--slate); line-height: 1.8;
}
.work-item__built-label {
  color: var(--amber); margin-right: 12px; font-size: 0.76rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.work-item__domain--plain { cursor: default; }
.work-item__domain--plain:hover { color: var(--ink); }

/* archive line */
.work-also {
  margin: 0; padding-top: clamp(30px, 4vw, 44px);
  font-family: var(--font-display); font-size: 0.85rem; color: var(--slate);
  line-height: 2;
}
.work-also__label {
  display: block; color: var(--amber); margin-bottom: 6px;
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ============================================================
   Open source
   ============================================================ */
.oss-lede { margin: -32px 0 56px; max-width: 52ch; color: var(--slate); font-size: 1.06rem; }
.oss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); }
.oss-group__h {
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--slate); margin: 0 0 4px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; border-bottom: 2px solid var(--amber);
}
.oss-group__all {
  font-family: var(--font-display); font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber);
  text-decoration: none; white-space: nowrap; transition: color 0.2s var(--ease);
}
.oss-group__all:hover { color: var(--amber-deep); }
.oss-list { list-style: none; margin: 0; padding: 0; }
.oss-item { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.oss-item__name {
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  display: inline-block; transition: color 0.2s var(--ease);
}
.oss-item__name:hover { color: var(--amber); }
.oss-item__desc { margin: 6px 0 0; color: var(--slate); font-size: 0.98rem; line-height: 1.55; max-width: 42ch; }

.oss-upstream {
  margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--rule);
  font-family: var(--font-display); font-size: 0.85rem; color: var(--slate); line-height: 1.8;
}
.oss-upstream__label {
  color: var(--amber); margin-right: 12px;
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
}

/* CTA */
.cta { padding-block: clamp(80px, 12vw, 150px); }
.cta__inner { max-width: 760px; }
.cta__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.06;
  letter-spacing: -0.03em; margin: 0 0 22px;
}
.cta__p { font-size: 1.12rem; color: var(--slate); max-width: 48ch; margin: 0 0 38px; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--rule-soft); padding: 56px 0 36px; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.footer__tag { margin: 14px 0 0; color: var(--slate); font-size: 0.95rem; max-width: 30ch; }
.footer__nav { display: flex; flex-direction: column; gap: 10px; }
.footer__nav a { text-decoration: none; color: var(--slate); font-size: 0.95rem; font-weight: 500; }
.footer__nav a:hover { color: var(--ink); }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule-soft);
  font-family: var(--font-display); font-size: 0.8rem; color: var(--slate-2);
  letter-spacing: 0.04em;
}
.footer__made { margin: 0; }

/* ============================================================
   Scroll reveal (subtle, once)
   ============================================================ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__graph { order: 2; }
  .process, .capabilities { grid-template-columns: repeat(2, 1fr); }
  .outcomes { grid-template-columns: 1fr; gap: 28px; }
  .work-item { grid-template-columns: 1fr; align-items: start; }
  .oss-grid { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 620px) {
  .nav { gap: 10px; }
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; padding: 9px 13px; font-size: 0.78rem; }
  .process, .capabilities { grid-template-columns: 1fr; }
  .mess-list__item { grid-template-columns: 44px 1fr; gap: 14px; }
  .work-item { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
