/* ==========================================================================
   Calad
   ========================================================================== */

/* Themes: follow the visitor's system setting; dark is the default --------- */
:root {
  --bg:          #0A0B0D;
  --bg-raised:   #111317;
  --text:        #EDEDEA;
  --text-soft:   #A1A19C;
  --text-mute:   #6A6A66;
  --line:        rgba(237, 237, 234, 0.07);
  --line-strong: rgba(237, 237, 234, 0.15);
  --accent:      #FF6B2C;   /* signal orange */
  --accent-fill: #FF6B2C;
  --accent-on:   #0A0B0D;
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:          #F6F6F4;
    --bg-raised:   #FFFFFF;
    --text:        #0B0C0E;
    --text-soft:   #47484D;
    --text-mute:   #85868B;
    --line:        rgba(11, 12, 14, 0.07);
    --line-strong: rgba(11, 12, 14, 0.15);
    --accent:      #C2410C;   /* orange, deepened so text stays legible */
    --accent-fill: #FF5A1F;
    --accent-on:   #0A0B0D;
  }
}

:root {
  --sans: "Geist", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max:    80rem;
  --section-space: clamp(5rem, 11vw, 9rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .4s ease, color .4s ease;
}

::selection { background: var(--accent-fill); color: var(--accent-on); }

h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main, .footer { position: relative; z-index: 1; }

.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--text);
  color: var(--bg);
  padding: .5rem 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  z-index: 100;
}
.skip:focus { left: 1rem; }

.nowrap { white-space: nowrap; }

/* Mono label voice */
.label,
.nav,
.button,
.spec dt,
.card__index,
.card__caps,
.step__index,
.work__row--head,
.work__client,
.work__tag,
.field__label,
.footer__meta,
.footer__top {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.label { color: var(--text-soft); }
.label--mute { color: var(--text-mute); }
.label__accent { color: var(--accent); margin-right: .5em; }

/* Column gridlines --------------------------------------------------------- */
.gridlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gridlines .wrap {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.gridlines span { border-left: 1px solid var(--line); }
.gridlines span:last-child { border-right: 1px solid var(--line); }

/* Masthead ----------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.wordmark__mark {
  width: .625rem;
  height: .625rem;
  background: var(--accent-fill);
  transition: background-color .3s ease;
}
.wordmark--small { font-size: .8125rem; }

.nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.5rem); color: var(--text-soft); }
.nav a { transition: color .2s ease; }
.nav a:hover { color: var(--text); }
.nav__inquire {
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: .5rem .875rem;
  transition: border-color .2s ease, color .2s ease;
}
.nav__inquire:hover { border-color: var(--accent); color: var(--accent); }

/* Buttons ------------------------------------------------------------------ */
.button {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  padding: 1rem 1.375rem;
  border: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.button--primary { background: var(--accent-fill); color: var(--accent-on); }
.button--primary:hover { background: var(--text); color: var(--bg); }
.button--ghost { border-color: var(--line-strong); color: var(--text); }
.button--ghost:hover { border-color: var(--text); }

/* Hero --------------------------------------------------------------------- */
.hero { padding: clamp(4rem, 10vw, 7.5rem) 0 0; }

.hero__grid {
  display: grid;
  gap: 4rem;
  align-items: center;
}
@media (min-width: 64rem) {
  .hero__grid { grid-template-columns: 3fr 2fr; gap: 3rem; }
}

.hero__copy .label { margin-bottom: 2rem; }

.hero__title {
  font-weight: 400;
  font-size: clamp(2.5rem, 4.6vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.hero__accent { display: block; color: var(--accent); transition: color .3s ease; }

.hero__lede {
  margin-top: 2rem;
  color: var(--text-soft);
  font-size: clamp(1.0625rem, .3vw + 1rem, 1.1875rem);
  line-height: 1.6;
  max-width: 34rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2.5rem;
}

/* Diagram */
.diagram { display: grid; gap: 1rem; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagram figcaption { text-align: right; }

.diagram__edges path,
.diagram__ticks path { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.diagram__flow path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 3 5;
  animation: flow 1.4s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -16; } }

.diagram__nodes rect { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.diagram__nodes rect.is-core { stroke: var(--text-soft); }
.diagram__nodes rect.is-active { stroke: var(--accent); }

.diagram__labels text {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  fill: var(--text-soft);
  text-anchor: middle;
}
.diagram__labels text.is-core { fill: var(--text); font-size: 11px; }
.diagram__labels text.is-sub  { fill: var(--text-mute); font-size: 9px; }

/* Spec strip */
.spec {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line-strong);
}
@media (min-width: 52rem) { .spec { grid-template-columns: repeat(4, 1fr); } }
.spec__cell { padding: 1.25rem 1.25rem 1.5rem 0; }
.spec dt { color: var(--text-mute); margin-bottom: .5rem; }
.spec dd { margin: 0; font-size: .9375rem; color: var(--text); }

/* Sections ----------------------------------------------------------------- */
.section { padding: var(--section-space) 0; }

.section__head {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}
@media (min-width: 64rem) {
  .section__head { grid-template-columns: 1fr 3fr; gap: 0; }
  .section__head .label { padding-top: .9rem; }
}

.section__title {
  font-weight: 400;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.section__intro {
  margin-top: 1.25rem;
  color: var(--text-soft);
  font-size: 1.0625rem;
  max-width: 34rem;
}

/* Practice cards */
.cards {
  display: grid;
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card {
  position: relative;
  background: var(--bg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem;
  min-height: 18rem;
  transition: background-color .3s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .5s var(--ease);
}
.card:hover { background: var(--bg-raised); }
.card:hover::before { width: calc(100% + 2px); }

.card__index { color: var(--accent); }
.card__title { font-weight: 500; font-size: 1.5rem; letter-spacing: -.025em; line-height: 1.2; }
.card__text { color: var(--text-soft); max-width: 30rem; }
.card__caps { color: var(--text-mute); padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* Wide card: the ongoing practice spans the full row */
.card--wide { grid-template-rows: auto; align-items: start; gap: 2rem; min-height: 0; }
@media (min-width: 48rem) {
  .card--wide { grid-column: 1 / -1; grid-template-columns: 3fr 2fr; gap: 3rem; }
}
@media (min-width: 64rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card--wide { grid-column: span 2; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
.card__main { display: grid; gap: 1rem; }
.card__badge {
  display: inline-block;
  margin: -.25rem 0 -.25rem .75rem;
  padding: .125rem .5rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .6875rem;
}
.card__list { border-top: 1px solid var(--line); }
.card__list li {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card__list li::before {
  content: "";
  width: .375rem;
  height: .375rem;
  background: var(--accent-fill);
  flex: none;
}

/* Operating model band */
.band {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(5rem, 11vw, 8rem) 0;
}
.band__inner { display: grid; gap: 2rem; }
@media (min-width: 64rem) {
  .band__inner { grid-template-columns: 1fr 3fr; gap: 0; }
  .band__inner .label { padding-top: .9rem; }
}
.band__text {
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  max-width: 30ch;
}

/* Steps */
.steps { display: grid; gap: 0; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step {
  position: relative;
  padding: 1.75rem 1.5rem 2rem 0;
  border-top: 1px solid var(--line-strong);
}
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}
.step__index { color: var(--text-mute); margin-bottom: 1.5rem; }
.step__title { font-weight: 500; font-size: 1.375rem; letter-spacing: -.02em; margin-bottom: .75rem; }
.step__text { color: var(--text-soft); max-width: 22rem; }

/* Work table */
.work { border-top: 1px solid var(--line-strong); }
.work__row {
  display: grid;
  gap: .5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 52rem) {
  .work__row {
    grid-template-columns: 1.3fr 3fr 1fr;
    gap: 2rem;
    align-items: baseline;
    padding: 1.75rem 0;
  }
  .work__tag,
  .work__row--head span:last-child { text-align: right; }
}
.work__row--head { color: var(--text-mute); padding: 1rem 0; }
@media (max-width: 51.99rem) { .work__row--head { display: none; } }

.work__client { color: var(--text-soft); }
.work__title { font-size: 1.1875rem; line-height: 1.4; letter-spacing: -.015em; max-width: 40rem; }
.work__tag { color: var(--accent); }

/* Inquire */
.section--inquire { border-top: 1px solid var(--line); }
.inquire { display: grid; gap: 3.5rem; }
@media (min-width: 64rem) { .inquire { grid-template-columns: 5fr 7fr; gap: 4rem; } }
.inquire__head .label { margin-bottom: 1.5rem; }

.inquire__direct {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  margin-top: 2.5rem;
}

.link {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color .2s ease;
}
.link:hover { color: var(--accent); }

.form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
}
.form__row { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: .5rem; }
.field__label { color: var(--text-mute); display: flex; justify-content: space-between; }
.field__opt { opacity: .7; }

.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: .875rem 1rem;
  transition: border-color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field.is-invalid input { border-color: var(--accent); }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: .5rem;
}
.form__status { color: var(--text-soft); font-size: .9375rem; }
.form__status a { color: var(--text); border-bottom: 1px solid var(--accent); }

.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form { position: relative; }
.form.is-sent > :not(.form__done) { display: none; }
.form__done { display: grid; gap: 1rem; padding: 1rem 0; }
.form__done[hidden] { display: none; }
.form__done-title { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.03em; line-height: 1.15; }
.form__done-text { color: var(--text-soft); }
.button[disabled] { opacity: .6; cursor: progress; }

/* Footer ------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 2rem 0; background: var(--bg); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer__meta { color: var(--text-mute); }
.footer__top { color: var(--text-soft); }
.footer__top:hover { color: var(--accent); }

/* Reveal ------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .diagram__flow path { animation: none; }
}

/* Small screens ------------------------------------------------------------ */
@media (max-width: 40rem) {
  .nav a:not(.nav__inquire) { display: none; }
  .gridlines .wrap { grid-template-columns: repeat(2, 1fr); }
  .gridlines span:nth-child(n+3) { display: none; }
  .gridlines span:nth-child(2) { border-right: 1px solid var(--line); }
}

@media print {
  .masthead, .form, .gridlines { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
