/* ===========================================================
   AI OfficeOS — site styles
   Design rule: the page is monochrome. Colour is reserved for
   state. If something is coloured, it is reporting a status.
   =========================================================== */

:root {
  --paper:        #F5F7F8;
  --surface:      #FFFFFF;
  --ink:          #14181D;
  --ink-2:        #4A545F;
  --ink-3:        #626F7B;
  --rule:         #DDE2E6;
  --rule-2:       #C2CAD1;

  /* state colours — functional only */
  --st-done:      #1D5A44;
  --st-done-bg:   #E4EFEA;
  --st-open:      #7E4E05;
  --st-open-bg:   #F6EDDD;
  --st-held:      #3D4977;
  --st-held-bg:   #E7EAF3;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono",
          "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --gutter: 20px;
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0E1216;
    --surface:    #161B21;
    --ink:        #E7EBEF;
    --ink-2:      #9EAAB6;
    --ink-3:      #7C8894;
    --rule:       #262E36;
    --rule-2:     #3A444E;

    --st-done:    #6FC7A1;
    --st-done-bg: #14261F;
    --st-open:    #DCA646;
    --st-open-bg: #2A2114;
    --st-held:    #97A3DC;
    --st-held-bg: #1A1E2E;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

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

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.wordmark {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.masthead-state {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}

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

.hero {
  padding-block: 60px 56px;
  border-bottom: 1px solid var(--rule);
}

.hero-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.6rem, 5.6vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0;
  max-width: 23ch;
  text-wrap: balance;
}

.hero-sub {
  margin: 22px 0 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  line-height: 1.58;
  color: var(--ink-2);
}

/* signature element: the typed state block */
.state {
  margin: 40px 0 0;
  border-top: 1px solid var(--rule-2);
  max-width: 620px;
}

.state-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding-block: 13px;
  border-bottom: 1px solid var(--rule);
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) backwards;
}
.state-row:nth-child(1) { animation-delay: .04s; }
.state-row:nth-child(2) { animation-delay: .12s; }
.state-row:nth-child(3) { animation-delay: .20s; }
.state-row:nth-child(4) { animation-delay: .28s; }

.state dt {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.state dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

@media (min-width: 560px) {
  .state-row {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    align-items: baseline;
  }
}

/* ---------- section bands ---------- */

.band {
  padding-block: 54px;
  border-bottom: 1px solid var(--rule);
}
.band-last { border-bottom: 0; }

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.band-body > h2 {
  margin: 0 0 20px;
  font-size: clamp(1.3rem, 3.6vw, 1.6rem);
  line-height: 1.28;
  letter-spacing: -0.014em;
  font-weight: 600;
  max-width: 24ch;
  text-wrap: balance;
}

.prose p {
  margin: 0 0 14px;
  max-width: var(--measure);
}
.prose p:last-child { margin-bottom: 0; }

.prose em { font-style: italic; }

.muted { color: var(--ink-2); }

@media (min-width: 880px) {
  .band { padding-block: 68px; }
  .band-grid {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 44px;
  }
  .hero { padding-block: 92px 80px; }
}

/* ---------- item lists ---------- */

.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.items > li {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.items h3 {
  margin: 0 0 5px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.items p {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 15.5px;
}

@media (min-width: 720px) {
  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 36px;
  }
}

/* ---------- loop / plain lists ---------- */

.loop {
  list-style: none;
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}

.loop > li {
  border-bottom: 1px solid var(--rule);
  padding-block: 9px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-2);
}

/* ---------- status ledger ---------- */

.ledger {
  width: 100%;
  margin-top: 26px;
  border-collapse: collapse;
  text-align: left;
}

.ledger thead { display: none; }

.ledger tbody tr {
  display: block;
  border-top: 1px solid var(--rule);
  padding-block: 16px;
}
.ledger tbody tr:last-child { border-bottom: 1px solid var(--rule); }

.ledger th,
.ledger td {
  display: block;
  padding: 0;
  font-weight: 400;
}

.ledger tbody th {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.ledger tbody td[data-cell="Detail"] {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 58ch;
}

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
  white-space: nowrap;
}

.chip-done { color: var(--st-done); background: var(--st-done-bg); }
.chip-open { color: var(--st-open); background: var(--st-open-bg); }
.chip-held { color: var(--st-held); background: var(--st-held-bg); }

@media (min-width: 780px) {
  .ledger thead {
    display: table-header-group;
  }
  .ledger thead th {
    display: table-cell;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 20px 10px 0;
    border-bottom: 1px solid var(--rule-2);
  }
  .ledger tbody tr {
    display: table-row;
    padding-block: 0;
    border-top: 0;
  }
  .ledger tbody tr:last-child { border-bottom: 0; }
  .ledger tbody th,
  .ledger tbody td {
    display: table-cell;
    vertical-align: top;
    padding: 15px 20px 15px 0;
    border-bottom: 1px solid var(--rule);
  }
  .ledger tbody th { margin-bottom: 0; width: 22%; }
  .ledger tbody td[data-cell="State"] { width: 22%; }
  .ledger tbody td[data-cell="Detail"] { margin-top: 0; padding-right: 0; }
}

/* ---------- architecture figure ---------- */

.figure {
  margin: 8px 0 0;
  padding: 0;
}

.loop-svg {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
}

.svg-node rect {
  fill: var(--surface);
  stroke: var(--rule-2);
  stroke-width: 1;
}

.svg-node-core rect {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.svg-node text {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-anchor: middle;
}

.svg-node-core text { font-weight: 600; }

.svg-line {
  fill: none;
  stroke: var(--rule-2);
  stroke-width: 1.25;
}

.svg-line-return { stroke-dasharray: 3 4; }

.svg-arrow { fill: var(--rule-2); }

.svg-return-label {
  fill: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-anchor: middle;
}

.figure figcaption {
  margin-top: 18px;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 14.5px;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule-2);
  padding-block: 30px 44px;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
  align-items: baseline;
}

.foot-state {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}

.foot-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------- motion preference ---------- */

@media (prefers-reduced-motion: reduce) {
  .state-row { animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- print ---------- */

@media print {
  .masthead, .skip { display: none; }
  body { background: #fff; color: #000; }
  .band { break-inside: avoid; }
}
