/* ─────────────────────────────────────────────────────────
   Shared styles for service-detail pages (project-dev / web /
   seo / cloud / managed-it / network / support / hardware /
   security). Editorial-masthead hero classes (.ed-*) plus the
   recurring below-the-fold components (build-grid, phases,
   tiers, stack-wall, related). Each page can still ship its
   own unique <style> for hero variants if needed.
   ───────────────────────────────────────────────────────── */

/* ── EDITORIAL MASTHEAD HERO (.ed-*) ───────────────────── */
.masthead {
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(56px, 6vw, 88px);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  position: relative; overflow: hidden;
}
.masthead::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--ink) 6%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent 60%, #000 95%);
  pointer-events: none;
}
.masthead .container { position: relative; }

.ed-bar {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--ink);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
}
.ed-bar .left, .ed-bar .right { display: flex; gap: 18px; align-items: baseline; }
.ed-bar .sep { opacity: .4; }
.ed-bar .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 30%, transparent);
  display: inline-block; transform: translateY(-1px);
}

.ed-masthead-rule {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 0 14px; border-bottom: 4px double var(--ink);
  font-weight: 400;
  font-size: clamp(14px, 1.5vw, 18px);
  color: var(--ink-2);
}
.ed-masthead-rule em { color: inherit; font-size: inherit; }
.ed-masthead-rule .name {
  font-family: var(--ff-display); font-style: normal;
  letter-spacing: .42em; text-transform: uppercase; font-weight: 600;
  font-size: clamp(11px, 1.1vw, 13px); color: var(--ink);
}
.ed-masthead-rule .est {
  font-family: var(--ff-mono); font-style: normal;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}

.ed-headline {
  margin-top: clamp(28px, 3vw, 44px);
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: clamp(54px, 8.4vw, 132px);
  line-height: .96;
  letter-spacing: -0.045em;
  color: var(--ink);
  max-width: 18ch;
}
.ed-headline .accent {
  color: var(--brand);
  font-size: 1.08em;
  letter-spacing: -0.03em;
}
.ed-headline .small {
  display: block;
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 32px);
  letter-spacing: -0.02em;
  color: var(--ink-2);
  margin-top: 18px;
  max-width: 30ch;
}

.ed-lede {
  margin-top: clamp(36px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(24px, 3vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.ed-lede .col h6 {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.ed-lede .col p {
  font-size: 15.5px; line-height: 1.65; color: var(--ink-2);
  column-fill: balance;
}
.ed-lede .col p::first-letter {
  font-weight: 600;
  font-size: 3.2em;
  float: left;
  line-height: .85;
  margin: 4px 8px 0 0;
  color: var(--brand);
}
.ed-lede .col .stat-row {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
  align-items: baseline; font-size: 14px;
  padding: 8px 0; border-bottom: 1px dotted var(--line);
}
.ed-lede .col .stat-row:last-child { border-bottom: 0; }
.ed-lede .col .stat-row b {
  font-family: var(--ff-display); font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--ink);
}
.ed-lede .col .stat-row b .unit {
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .12em; margin-left: 4px;
}
.ed-lede .col .stat-row span {
  font-size: 13px; color: var(--ink-2); line-height: 1.4;
}
.ed-lede .clip {
  background: var(--ink); color: var(--paper);
  padding: 20px; border-radius: var(--r-md);
  font-family: var(--ff-mono); font-size: 12.5px;
  line-height: 1.55; letter-spacing: -0.005em;
  position: relative;
}
.ed-lede .clip::before {
  content: attr(data-edition);
  display: block; font-size: 10px; letter-spacing: .14em;
  color: color-mix(in oklab, var(--paper) 50%, transparent);
  margin-bottom: 12px;
}
.ed-lede .clip code { color: var(--brand); }
.ed-lede .clip .ln { color: color-mix(in oklab, var(--paper) 35%, transparent); margin-right: 10px; user-select: none; }
.ed-lede .clip .up { color: #5fcf8a; }
.ed-lede .clip .dn { color: #f0a060; }

.ed-foot {
  margin-top: clamp(32px, 3vw, 48px);
  padding-top: 16px; border-top: 1px solid var(--ink);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.ed-foot .stack-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-foot .stack-chips .chip {
  padding: 4px 10px; border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 10.5px; letter-spacing: .1em; color: var(--ink-2);
  background: var(--paper);
}
.ed-foot .stack-chips .chip.k {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

@media (max-width: 900px) {
  .ed-lede { grid-template-columns: 1fr; }
  .ed-headline { font-size: clamp(44px, 9vw, 64px); }
}

/* ── BUILD MENU (what we do · grid of cards) ───────────── */
.build-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.build-card {
  padding: clamp(24px, 2.4vw, 36px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  transition: background .2s ease;
}
.build-card:hover { background: var(--paper-2); }
.build-card .nx {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
}
.build-card h4 {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.2vw, 28px); font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.15;
  margin-top: 14px;
}
.build-card h4 .it {
  color: var(--brand); font-size: 1.08em;
}
.build-card p {
  font-size: 14.5px; color: var(--ink-2); line-height: 1.6;
  margin-top: 12px;
}
.build-card .examples {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-3);
}
.build-card .examples span { padding: 3px 9px; background: var(--paper-2); border-radius: 999px; border: 1px solid var(--line); }
.build-card .examples span.ai {
  color: var(--brand);
  background: color-mix(in oklab, var(--brand) 8%, var(--paper));
  border-color: color-mix(in oklab, var(--brand) 28%, var(--line));
  font-weight: 500;
}
.build-card .nx .ai-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand) 14%, var(--paper));
  color: var(--brand);
  font-family: var(--ff-mono); font-size: 9.5px;
  letter-spacing: .14em;
  border: 1px solid color-mix(in oklab, var(--brand) 38%, var(--line));
  vertical-align: middle;
}
.build-card.build-card--ai {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--brand) 6%, var(--paper)) 0%,
    var(--paper) 100%);
  position: relative;
}
.build-card.build-card--ai::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 90% 10%,
    color-mix(in oklab, var(--brand) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.build-card.build-card--ai > * { position: relative; }
@media (max-width: 900px) { .build-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .build-grid { grid-template-columns: 1fr; } }

/* ── PHASES (vertical timeline) ────────────────────────── */
.phases { display: grid; grid-template-columns: 200px 1fr; gap: 0; position: relative; }
.phase { display: contents; }
.phases .axis {
  grid-column: 1 / 2;
  padding: 28px 24px 56px 0;
  border-right: 1px solid var(--line);
  position: relative;
}
.phases .axis::before {
  content: ""; position: absolute; right: -5px; top: 36px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--brand);
}
.phase:nth-child(1) .axis::before {
  background: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 25%, transparent);
}
.phases .axis .step {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
}
.phases .axis .when {
  font-family: var(--ff-display); font-weight: 500;
  font-size: 22px; letter-spacing: -0.02em;
  color: var(--ink); margin-top: 6px;
}
.phases .axis .when .unit { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .14em; margin-left: 4px; }
.phases .body {
  grid-column: 2 / 3;
  padding: 28px 0 56px clamp(24px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
}
.phase:last-child .body { border-bottom: 0; }
.phases .body h3 {
  font-family: var(--ff-display);
  font-size: clamp(26px, 2.6vw, 36px); font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.15;
}
.phases .body h3 .accent {
  color: var(--brand);
  font-size: 1.08em;
}
.phases .body p { font-size: 15.5px; color: var(--ink-2); line-height: 1.65; margin-top: 14px; max-width: 65ch; }
.phases .body .arts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.phases .body .arts .art {
  padding: 6px 12px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px;
}
.phases .body .arts .art::before { content: "→"; color: var(--brand); font-size: 11px; }
@media (max-width: 720px) {
  .phases { grid-template-columns: 1fr; }
  .phases .axis { padding: 18px 0 8px; border-right: 0; border-bottom: 1px dashed var(--line); }
  .phases .axis::before { display: none; }
  .phases .body { padding: 18px 0 36px; }
}

/* ── PRICING TIERS ─────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tier {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(28px, 3vw, 40px);
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.tier.is-featured { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tier.is-featured::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--brand) 35%, transparent), transparent 70%);
  pointer-events: none;
}
.tier .who {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
  display: flex; align-items: center; gap: 8px;
}
.tier.is-featured .who { color: var(--brand); }
.tier .who .badge { padding: 2px 8px; border-radius: 999px; background: var(--brand); color: var(--paper); font-size: 10px; letter-spacing: .12em; }
.tier h3 {
  font-family: var(--ff-display);
  font-size: clamp(28px, 2.6vw, 36px); font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.15;
}
.tier h3 .it { color: var(--brand); font-size: 1.08em; }
.tier .price {
  font-family: var(--ff-display);
  font-size: clamp(40px, 4vw, 56px); font-weight: 500;
  letter-spacing: -0.035em; line-height: 1;
}
.tier .price small { font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0; color: var(--ink-3); margin-left: 6px; }
.tier.is-featured .price small { color: color-mix(in oklab, var(--paper) 60%, transparent); }
.tier .lede { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.tier.is-featured .lede { color: color-mix(in oklab, var(--paper) 75%, transparent); }
.tier ul { list-style: none; padding: 0; margin-top: 4px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.tier.is-featured ul { color: color-mix(in oklab, var(--paper) 80%, transparent); }
.tier ul li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: baseline; line-height: 1.5; }
.tier ul li::before { content: "✓"; color: var(--brand); font-size: 13px; }
.tier .cta {
  margin-top: auto; padding-top: 18px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.tier.is-featured .cta { border-color: color-mix(in oklab, var(--paper) 25%, transparent); }
.tier .cta a {
  font-family: var(--ff-display); font-weight: 500; font-size: 15px;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: -0.01em;
}
.tier.is-featured .cta a { color: var(--paper); }
.tier .cta a:hover { color: var(--brand); }
.tier .cta .micro { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tier.is-featured .cta .micro { color: color-mix(in oklab, var(--paper) 55%, transparent); }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }

/* ── STACK GRID — card-based directory ─────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .stack-grid { grid-template-columns: 1fr; } }

.stack-wall {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 26px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  /* override legacy row layout */
  grid-template-columns: none;
  gap: 0;
}
.stack-wall::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), color-mix(in oklab, var(--brand) 40%, transparent));
  opacity: 0;
  transition: opacity .25s ease;
}
.stack-wall:hover {
  border-color: color-mix(in oklab, var(--brand) 38%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px color-mix(in oklab, var(--ink) 40%, transparent);
}
.stack-wall:hover::before { opacity: 1; }
.stack-wall:last-child { border-bottom: 1px solid var(--line); }

.stack-wall .label {
  display: block;
  width: 100%;
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}
.stack-wall .label b {
  display: block;
  font-family: var(--ff-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  margin: 6px 0 0;
}

.stack-wall .chips {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-wrap: nowrap;
}
.stack-wall .chips .ch {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 9px 0 9px 22px;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  border-bottom: 1px dotted var(--line);
}
.stack-wall .chips .ch:last-child {
  border-bottom: 0;
}
.stack-wall .chips .ch::before {
  content: "·";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 22px;
  font-weight: 700;
  line-height: 0;
}
.stack-wall .chips .ch.fav {
  color: var(--ink);
  font-weight: 500;
}
.stack-wall .chips .ch.fav::before {
  content: "▲";
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
  left: 8px;
}
.stack-wall .chips .ch.alt {
  color: var(--ink-3);
}
.stack-wall .chips .ch.alt::before {
  content: "─";
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  color: var(--ink-3);
  left: 6px;
}

/* ── RELATED LINKS ─────────────────────────────────────── */
.related {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: clamp(36px, 3vw, 48px);
}
.related a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line);
  transition: border-color .2s ease, transform .2s ease;
}
.related a:hover { border-color: var(--brand); transform: translateY(-2px); }
.related a .meta { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.related a .name { font-family: var(--ff-display); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.related a .arrow { margin-top: 8px; color: var(--brand); font-family: var(--ff-mono); font-size: 12px; }
@media (max-width: 800px) { .related { grid-template-columns: 1fr 1fr; } }
