/* Projik Ai — drafting-sheet design system */

:root {
  --paper: #F6F4EF;
  --ink: #1D1C1A;
  --graphite: #6B6960;
  --redline: #D64218;
  --redline-deep: #A93A12;
  --grid: #DCD8CE;
  --blackboard: #232220;

  --sans: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --display: "Space Grotesk", sans-serif;

  --max-w: 1152px;
  --gutter: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Type scale ---------- */

h1, h2, h3, h4 { font-family: var(--display); }
h1 { font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 30px; line-height: 1.15; font-weight: 700; }
h3 { font-size: 24px; line-height: 1.25; font-weight: 500; }
h4 { font-size: 20px; line-height: 1.3; font-weight: 500; }
h5 { font-size: 17px; line-height: 1.4; font-family: var(--sans); font-weight: 600; }

@media (min-width: 768px) {
  body { font-size: 17px; }
  h1 { font-size: 64px; }
  h2 { font-size: 40px; }
  h3 { font-size: 28px; }
  h4 { font-size: 22px; }
  h5 { font-size: 18px; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--graphite);
  display: block;
  margin-bottom: 16px;
}

.small, .caption {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

p { max-width: 68ch; }

a { color: var(--redline-deep); }

/* Focus states — visible on Paper and Blackboard */
:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */

.wrap {
  max-width: calc(var(--max-w) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: 64px; }
@media (min-width: 768px) { section { padding-block: 72px; } }

.grid { display: block; }
@media (min-width: 1024px) {
  .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
  }
}

.prose { max-width: 68ch; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--redline);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  padding: 14px 28px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.btn:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.text-link {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--redline-deep);
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* ---------- Redline annotations ---------- */

.redlined { position: relative; white-space: nowrap; }
.redlined > svg {
  position: absolute;
  left: -0.1em;
  right: -0.1em;
  bottom: -0.28em;
  width: calc(100% + 0.2em);
  height: 0.32em;
  overflow: visible;
}
.redlined > svg path {
  fill: none;
  stroke: var(--redline);
  stroke-width: 3;
  stroke-linecap: round;
}
/* Tight heading line-height leaves no room for the hang below the em box */
h1 .redlined > svg { bottom: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.scrolled { border-bottom-color: var(--grid); }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.ai-i { position: relative; display: inline-block; line-height: 1; }
.ai-i .tittle {
  position: absolute;
  top: -0.18em;
  left: 50%;
  transform: translateX(-50%);
  width: 0.18em;
  height: 0.18em;
  border-radius: 50%;
  background: var(--redline);
}

.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav ul { display: flex; gap: 32px; list-style: none; }
.site-nav ul a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 4px;
}
.site-nav ul a[aria-current="page"] {
  border-bottom: 2px solid var(--redline);
}
.nav-cta { padding: 10px 20px; font-size: 15px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
}

@media (max-width: 767px) {
  .nav-toggle { display: block; position: relative; z-index: 60; }
  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 55;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    text-align: center;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 32px; }
  .site-nav ul a { font-family: var(--display); font-size: 32px; font-weight: 500; }
}

/* ---------- Footer & blackboard bands ---------- */

.site-footer {
  background: var(--blackboard);
  color: var(--paper);
  padding-block: 48px;
}
.footer-row {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 768px) {
  .footer-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.wordmark-footer { color: var(--paper); font-size: 20px; }
.footer-brand p { font-size: 14px; color: var(--grid); margin-top: 8px; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-nav a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.footer-nav a:hover { text-decoration: underline; }
.footer-cta-link {
  color: var(--redline);
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
}
.footer-cta-link:hover { text-decoration: underline; }
.legal { font-family: var(--mono); font-size: 13px; color: var(--graphite); margin-top: 8px; }

.cta-band {
  background: var(--blackboard);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: var(--paper); }
.cta-band p { color: var(--grid); margin-block: 16px 32px; }
.cta-band .band-fragment {
  position: absolute;
  right: 24px;
  bottom: 24px;
  opacity: 0.25;
}
.cta-band .wrap { position: relative; z-index: 1; }

/* ---------- Ledgers ---------- */

.ledger { list-style: none; border-top: 1px solid var(--grid); max-width: 100%; }
.ledger > li {
  border-bottom: 1px solid var(--grid);
  padding-block: 28px;
  display: grid;
  gap: 8px;
}
@media (min-width: 768px) {
  .ledger > li { grid-template-columns: 80px 1fr; gap: var(--gutter); }
}
.ledger .index {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--graphite);
}
.ledger h3, .ledger h4 { margin-bottom: 6px; }
.ledger p { color: var(--graphite); }

/* Un-numbered principles ledger */
.ledger-plain > li { grid-template-columns: 1fr; }

/* ---------- Panels (What we build) ---------- */

.panel-grid {
  display: grid;
  gap: var(--gutter);
  margin-top: 48px;
}
@media (min-width: 768px) { .panel-grid { grid-template-columns: 1fr 1fr; } }

.panel {
  border: 1px solid var(--grid);
  padding: 32px;
  transition: border-color 200ms ease;
}
.panel:hover { border-color: var(--ink); }
.panel .index {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--redline-deep);
  display: block;
  margin-bottom: 20px;
}
.panel h3 { margin-bottom: 12px; }
.panel p { color: var(--graphite); }
.panel-link { text-decoration: none; color: inherit; display: block; }

/* ---------- Fit section ---------- */

.fit-grid { margin-top: 48px; }
@media (min-width: 768px) {
  .fit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .fit-col-yes { padding-right: 40px; border-right: 1px solid var(--grid); }
  .fit-col-no { padding-left: 40px; margin-top: 0; }
}
.fit-grid h3 { margin-bottom: 24px; }
.fit-list { list-style: none; }
.fit-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--grid);
}
.fit-list .mark { font-family: var(--mono); font-weight: 500; }
.fit-col-yes .mark { color: var(--redline-deep); }
.fit-col-no { color: var(--graphite); margin-top: 48px; }
.fit-col-no h3 { color: var(--ink); }
.fit-closing {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--graphite);
  margin-top: 40px;
}

/* ---------- Home hero ---------- */

.hero { padding-block: 64px; }
@media (min-width: 768px) { .hero { padding-block: 96px; } }
.hero-copy { grid-column: 1 / span 7; }
.hero-copy h1 { margin-bottom: 24px; }
.hero-copy .subhead { color: var(--graphite); font-size: 18px; margin-bottom: 40px; }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero-diagram { grid-column: 8 / span 5; margin-top: 48px; }
@media (min-width: 1024px) { .hero-diagram { margin-top: 0; } }
.hero-diagram svg { width: 100%; height: auto; display: block; }

/* ---------- Schematic SVG language ---------- */

.schematic { font-family: var(--mono); }
.schematic .box { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.schematic .flow { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.schematic .dash { fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-dasharray: 4 4; }
.schematic .red { fill: none; stroke: var(--redline); stroke-width: 2; }
.schematic .red-fill { fill: var(--redline); stroke: none; }
.schematic .ink-fill { fill: var(--ink); stroke: none; }
.schematic text {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--ink);
  letter-spacing: 0.08em;
}
.schematic text.dim { fill: var(--graphite); font-size: 11px; }
.schematic text.red-label { fill: var(--redline); }
.schematic .graph-grid { stroke: var(--grid); stroke-width: 1; }

/* ---------- Process timeline (home) ---------- */

.timeline { margin-top: 56px; }
.timeline-svg { display: none; }
.timeline-stations { list-style: none; }

@media (min-width: 768px) {
  .timeline-svg { display: block; width: 100%; height: auto; }
  .timeline-stations {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 12px;
  }
  .timeline-stations li { text-align: center; padding-inline: 8px; }
  .timeline-stations li .index { display: block; margin-bottom: 8px; }
}

.timeline-stations .index {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--redline-deep);
}
.timeline-stations li { font-size: 15px; color: var(--graphite); }
.timeline-stations li strong {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}

@media (max-width: 767px) {
  .timeline-stations { border-left: 1.5px solid var(--ink); }
  .timeline-stations li {
    position: relative;
    padding: 12px 0 12px 28px;
  }
  .timeline-stations li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24px;
    width: 12px;
    height: 1.5px;
    background: var(--ink);
  }
}

.section-link { margin-top: 40px; }

/* ---------- Services page ---------- */

.page-hero { padding-block: 64px 24px; }
@media (min-width: 768px) { .page-hero { padding-block: 96px 32px; } }
.page-hero .subhead { color: var(--graphite); font-size: 18px; margin-top: 24px; }

.service-block { border-top: 1px solid var(--grid); }
.service-head { grid-column: 1 / span 4; }
@media (min-width: 1024px) {
  .service-head { position: sticky; top: 104px; align-self: start; }
}
.service-head .index {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--redline-deep);
  display: block;
  margin-bottom: 12px;
}
.service-head svg { margin-top: 40px; width: 100%; max-width: 260px; height: auto; }
.service-body { grid-column: 5 / span 8; margin-top: 32px; }
@media (min-width: 1024px) { .service-body { margin-top: 0; } }
.service-body > p { margin-bottom: 20px; }

.bom-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--graphite);
  margin-bottom: 12px;
}
.bom { list-style: none; border-top: 1px solid var(--grid); margin-bottom: 40px; }
.bom li {
  border-bottom: 1px solid var(--grid);
  padding: 14px 0 14px 28px;
  position: relative;
}
.bom li::before {
  content: "—";
  font-family: var(--mono);
  color: var(--redline-deep);
  position: absolute;
  left: 0;
}
.fit-line { color: var(--graphite); }
.fit-line strong { color: var(--ink); font-weight: 600; }

/* ---------- How we work: phase rail ---------- */

.phase-rail {
  position: relative;
  border-left: 1.5px solid var(--ink);
  margin-left: 8px;
  padding-bottom: 40px;
}
.phase-rail::after {
  /* rail terminates in a Redline arrowhead pointing off-page */
  content: "";
  position: absolute;
  left: -7px;
  bottom: -14px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 12px solid var(--redline);
  margin-left: 0.25px;
}
.phase {
  position: relative;
  padding: 48px 0 48px 40px;
}
@media (min-width: 768px) { .phase { padding-left: 64px; } }
.phase::before {
  content: "";
  position: absolute;
  left: 0;
  top: 60px;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
}
.phase.phase-marked::before { background: var(--redline); height: 3px; top: 59px; }
.phase h2 { margin-bottom: 16px; }
.phase h2 .num { font-family: var(--mono); font-weight: 500; font-size: 0.6em; color: var(--graphite); vertical-align: middle; margin-right: 12px; }
.artifact {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 24px;
  padding-left: 28px;
  position: relative;
  max-width: 60ch;
}
.artifact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 18px;
  height: 2px;
  background: var(--redline);
}

/* ---------- Notes panel (revision-notes block) ---------- */

.notes-panel {
  border: 1px solid var(--ink);
  padding: 32px;
  max-width: 56ch;
}
.notes-panel h2, .notes-panel h3 { margin-bottom: 16px; }
.notes-panel .text-link { display: inline-block; margin-top: 16px; }

/* ---------- About ---------- */

.thesis h1 { max-width: 22ch; }
.about-section h2 { margin-bottom: 24px; }

/* ---------- Contact ---------- */

.contact-grid { margin-top: 24px; align-items: start; }
.scheduler-col { grid-column: 1 / span 7; }
.form-col { grid-column: 8 / span 5; margin-top: 48px; }
@media (min-width: 1024px) { .form-col { margin-top: 0; } }

.scheduler-frame { border: 1px solid var(--grid); }
.scheduler-col h2, .form-col h2 { margin-bottom: 12px; }
.scheduler-col > p, .form-col > p { color: var(--graphite); margin-bottom: 24px; }

.contact-form { display: grid; gap: 20px; }
.contact-form label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--graphite); opacity: 0.7; }
.form-success {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--redline-deep);
  border: 1px solid var(--grid);
  padding: 20px;
}

/* ---------- Draw-in animation ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
