/* ============================================================
   AURO design engine — showroom
   Intention: an atelier ledger. The engine's learning made
   visible — every rule traceable to a human sentence, every
   version an exhibit. Paper + ink + one rubber-stamp green.
   Boldness is spent on the provenance stamps and the live
   before/after exhibit; everything else stays quiet.
   ============================================================ */

:root {
  --paper: #FBFAF6;
  --ink: #20242E;
  --meta: #666E7D;
  --line: rgba(32, 36, 46, 0.16);
  --line-soft: rgba(32, 36, 46, 0.09);
  --wash: #F2F1EA;
  --green: #1E6B4F;
  --green-deep: #14523B;
  --green-wash: rgba(30, 107, 79, 0.07);
  --display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.07rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.2rem); }

a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--green); color: var(--paper); }

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

.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.4rem 0 1.1rem;
  border-bottom: 1px solid var(--ink);
}
@media (min-width: 760px) {
  .masthead { position: sticky; top: 0; background: var(--paper); z-index: 40; }
}
.masthead .brand {
  font-family: var(--display);
  font-weight: 700; font-size: 1.5rem; letter-spacing: 0.04em;
  color: var(--ink); text-decoration: none;
}
.masthead .brand span { color: var(--green); }
.masthead .desk {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--meta); text-align: right;
}
.masthead .desk a { color: var(--meta); display: inline-block; padding: 0.5em 0; }
.masthead .desk a:hover { color: var(--green-deep); }

/* ---------- stamps & tags (the signature system) ---------- */

.stamp {
  display: inline-block;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--green-deep);
  border: 1.6px solid currentColor; border-radius: 3px;
  padding: 0.28em 0.65em;
  transform: rotate(-1.6deg);
  background: var(--paper);
  white-space: nowrap;
}
.stamp.flat { transform: rotate(1.1deg); }
.stamp.ghost { color: var(--meta); border-style: dashed; }

/* imprint animation only when JS is present (html.js) — no-JS keeps stamps visible */
@media (prefers-reduced-motion: no-preference) {
  html.js .stamp.inkable { opacity: 0; transform: rotate(-1.6deg) scale(1.25); }
  html.js .stamp.inkable.flat { transform: rotate(1.1deg) scale(1.25); }
  html.js .stamp.inked { opacity: 1; transform: rotate(-1.6deg) scale(1); transition: opacity 0.18s ease-out, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  html.js .stamp.inked.flat { transform: rotate(1.1deg) scale(1); }
}
@media (max-width: 400px) {
  .stamp { white-space: normal; }
}

.tag {
  display: inline-block;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.16em 0.5em; border-radius: 3px;
}
.tag.yours { color: var(--green-deep); background: var(--green-wash); border: 1px solid rgba(30, 107, 79, 0.35); }
.tag.ours { color: var(--meta); background: transparent; border: 1px dashed var(--line); }

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

.hero { padding: clamp(2.6rem, 7vw, 4.6rem) 0 clamp(1.8rem, 4vw, 2.6rem); }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.15rem, 5.6vw, 3.7rem);
  font-weight: 640; line-height: 1.04; letter-spacing: -0.015em;
  max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--green); }
.hero .lead {
  margin-top: 1.3rem; max-width: 58ch;
  font-size: clamp(1.08rem, 1.6vw, 1.22rem); line-height: 1.6;
}
.hero .lead + .lead { margin-top: 0.65rem; }

/* ---------- sections ---------- */

section { padding: clamp(2rem, 5vw, 3.4rem) 0; }
section + section { border-top: 1px solid var(--line-soft); }

.kicker {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--green-deep);
  margin-bottom: 0.7rem;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 620; line-height: 1.12; letter-spacing: -0.01em;
  max-width: 24ch;
}
.sub { margin-top: 0.8rem; max-width: 62ch; color: var(--ink); }
.sub.dim { color: var(--meta); font-size: 0.98rem; }

/* ---------- exhibit A: the pair ---------- */

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 2rem; }
.exhibit { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.exhibit .plate { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

.peek {
  position: relative; display: block;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
}
.peek .cover { position: absolute; inset: 0; border-radius: 6px; }
/* soften the hard crop at the frame's bottom edge */
.peek .viewport::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 42px;
  background: linear-gradient(to bottom, transparent, rgba(251, 250, 246, 0.55));
  pointer-events: none;
}
.peek .viewport { display: block; position: relative; overflow: hidden; height: var(--peek-h, 340px); max-width: 100%; }
/* base layer: a real screenshot (works with no JS, on any width) */
.peek .still {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
/* enhancement layer: the live site, swapped in by JS on wide screens */
.peek iframe {
  position: absolute; inset: 0 auto auto 0;
  width: 1280px; height: 2000px; border: 0;
  transform-origin: 0 0; transform: scale(var(--peek-s, 0.4));
  pointer-events: none;
  background: #fff;
  opacity: 0;
}
.peek.live iframe { opacity: 1; transition: opacity 0.25s ease-in; }
.peek .visit {
  position: absolute; inset: auto 0.7rem 0.7rem auto;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.07em;
  color: var(--paper); background: var(--ink);
  padding: 0.45em 0.8em; border-radius: 4px;
}
.peek .cover:hover .visit, .peek .cover:focus-visible .visit { background: var(--green-deep); }

@media (max-width: 759px) {
  .pair { grid-template-columns: 1fr; }
  .peek .viewport { height: 430px; }
}

.ask {
  margin-top: 1.8rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 1.15rem 1.3rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem;
  background: var(--green-wash);
}
.ask p { flex: 1 1 30ch; font-size: 1.05rem; }
.ask p b { font-family: var(--display); font-weight: 640; }

.wa {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--display); font-weight: 620; font-size: 0.95rem;
  color: var(--paper); background: var(--green-deep);
  padding: 0.4em 1.1em; border-radius: 6px;
  text-decoration: none; white-space: nowrap;
}
.wa:hover { background: var(--green); color: var(--paper); }

/* ---------- brief sheet (anatomy page) ---------- */

.briefsheet { border: 1px solid var(--line); border-radius: 6px; margin-top: 1.6rem; background: var(--paper); max-width: 50rem; }
.briefsheet dl > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.75rem 1.1rem; border-bottom: 1px dotted var(--line-soft); }
.briefsheet dl > div:last-child { border-bottom: none; }
.briefsheet dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green-deep); padding-top: 0.25rem; }
.briefsheet dd { font-size: 0.98rem; }
@media (max-width: 560px) { .briefsheet dl > div { grid-template-columns: 1fr; gap: 0.15rem; } }

/* ---------- the loop ---------- */

.loop { margin-top: 1.8rem; border-top: 1px solid var(--line); }
.loop li {
  list-style: none;
  display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--line-soft);
}
.loop li:last-child { border-bottom: none; }
.loop .n { font-family: var(--mono); font-size: 0.85rem; color: var(--green-deep); padding-top: 0.3rem; }
.loop b { font-family: var(--display); font-weight: 630; font-size: 1.08rem; display: block; margin-bottom: 0.15rem; }
.loop p { color: var(--ink); font-size: 1rem; max-width: 60ch; }
.loop p .aside { color: var(--meta); }

/* ---------- the wall ---------- */

.rowhead {
  display: flex; align-items: baseline; gap: 1rem;
  margin: 2.4rem 0 1rem;
}
.rowhead h3 { font-family: var(--display); font-weight: 630; font-size: 1.18rem; white-space: nowrap; }
.rowhead .rule { flex: 1; border-top: 1px solid var(--line); transform: translateY(-0.2em); }
.rowhead .whenmade { font-family: var(--mono); font-size: 0.7rem; color: var(--meta); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 640px) {
  .rowhead { flex-wrap: wrap; gap: 0.3rem 0.8rem; }
  .rowhead h3 { white-space: normal; }
  .rowhead .rule { display: none; }
}

.wall { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wall.solo { grid-template-columns: 1fr; }
@media (max-width: 700px) { .wall { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 1.05rem 1.15rem 1.15rem;
  background: var(--paper);
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--ink); }
.card .cardtop { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin-bottom: 0.35rem; }
.card h4, .card b { font-family: var(--display); font-weight: 640; font-size: 1.1rem; }
.card .lang { font-family: var(--mono); font-size: 0.68rem; color: var(--meta); letter-spacing: 0.1em; }
.card p { font-size: 0.97rem; color: var(--ink); opacity: 0.88; }
.card .go { display: inline-block; margin-top: auto; padding-top: 0.55rem; font-family: var(--mono); font-size: 0.74rem; color: var(--green-deep); }

.card.zero { background: var(--wash); }
.card.zero .verdict { margin: 0.6rem 0 0.2rem; }

/* ---------- versions strip ---------- */

.versions { margin-top: 1.6rem; border-top: 1px solid var(--line); }
.vrow {
  display: grid; grid-template-columns: 6.4rem 1fr; gap: 1.2rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.vrow .vmark { padding-top: 0.15rem; }
.vrow p { max-width: 62ch; font-size: 1.01rem; }
.vrow p b { font-family: var(--display); font-weight: 630; }
@media (max-width: 540px) { .vrow { grid-template-columns: 1fr; gap: 0.4rem; } }

.tolab { margin-top: 1.4rem; }
.tolab a { font-family: var(--display); font-weight: 630; font-size: 1.05rem; }

/* ---------- questions ---------- */

.q {
  border: 1px solid var(--line); border-radius: 6px;
  margin-top: 0.9rem; background: var(--paper);
}
.q summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: 0.9rem;
  padding: 1rem 1.2rem;
  font-family: var(--display); font-weight: 630; font-size: 1.1rem;
}
.q summary::-webkit-details-marker { display: none; }
.q summary .qn { font-family: var(--mono); font-size: 0.78rem; font-weight: 400; color: var(--green-deep); }
.q summary .hintword { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; font-weight: 400; color: var(--meta); letter-spacing: 0.08em; white-space: nowrap; }
.q summary::after { content: "▾"; margin-left: 0.8rem; color: var(--green-deep); font-family: var(--mono); font-size: 0.85rem; transition: transform 0.15s ease; }
.q[open] summary::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .q summary::after { transition: none; } }
@media (max-width: 600px) { .q summary .hintword { display: none; } }
.q[open] summary { border-bottom: 1px solid var(--line-soft); }
.q .qbody { padding: 1rem 1.2rem 1.2rem; }
.q .qbody p { max-width: 62ch; font-size: 1rem; }
.q .qbody p + p { margin-top: 0.6rem; }
.q .qbody .wa { margin-top: 0.9rem; }
.proposal { font-family: var(--mono); font-size: 0.86rem; line-height: 1.7; background: var(--wash); border-radius: 4px; padding: 0.8rem 1rem; margin: 0.7rem 0; max-width: 46rem; }

/* ---------- skill page ---------- */

.filenote {
  font-family: var(--mono); font-size: 0.78rem; color: var(--meta);
  border: 1px dashed var(--line); border-radius: 4px;
  padding: 0.7rem 0.9rem; margin-top: 1.4rem; max-width: 46rem;
}

.vstory { border-left: 3px solid var(--line); padding: 0.2rem 0 0.2rem 1.4rem; margin-top: 2rem; }
.vstory.current { border-left-color: var(--green); }
.vstory .vhead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.vstory h3 { font-family: var(--display); font-weight: 650; font-size: 1.45rem; }
.vstory p { max-width: 64ch; margin-top: 0.55rem; }
.vstory ol { margin: 0.8rem 0 0.4rem 1.2rem; max-width: 62ch; }
.vstory ol li { margin-top: 0.55rem; padding-left: 0.3rem; }
.vstory ol li b { font-family: var(--display); font-weight: 630; }

.spec {
  border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: 5px; background: var(--paper);
  padding: 0.9rem 1.1rem; margin: 0.9rem 0; max-width: 46rem;
}
.spec blockquote { font-size: 1.06rem; font-style: italic; }
.spec .ref { display: block; margin-top: 0.45rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--meta); text-transform: uppercase; }

.rulebook { margin-top: 1.6rem; border-top: 1px solid var(--line); }
.rule-item {
  display: grid; grid-template-columns: 3rem 1fr; gap: 1rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line-soft);
}
.rule-item:last-child, .direction-list li:last-child, .floor li:last-child { border-bottom: none; }
.rule-item .rn { font-family: var(--mono); font-size: 0.85rem; color: var(--green-deep); padding-top: 0.35rem; }
.rule-item .rulehead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.7rem; margin-bottom: 0.3rem; }
.rule-item h3 { font-family: var(--display); font-weight: 640; font-size: 1.12rem; }
.rule-item p { font-size: 0.99rem; max-width: 66ch; opacity: 0.92; }
@media (max-width: 540px) { .rule-item { grid-template-columns: 2.2rem 1fr; gap: 0.7rem; } }

.direction-list { margin-top: 1.4rem; }
.direction-list li { list-style: none; padding: 0.85rem 0; border-bottom: 1px solid var(--line-soft); max-width: 68ch; }
.direction-list b { font-family: var(--display); font-weight: 630; }
.direction-list .fail { display: block; margin-top: 0.2rem; font-size: 0.9rem; color: var(--meta); }
.direction-list .fail::before { content: "failure mode — "; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

.floor { margin-top: 1.4rem; font-family: var(--mono); font-size: 0.85rem; line-height: 1.75; }
.floor li { list-style: none; padding: 0.35rem 0; border-bottom: 1px dotted var(--line-soft); max-width: 60rem; }
.floor li .fn { color: var(--green-deep); margin-right: 0.7rem; }

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

footer { margin-top: 2rem; border-top: 1px solid var(--ink); padding: 2rem 0 3rem; }
footer .houserules { max-width: 66ch; font-size: 0.95rem; color: var(--ink); opacity: 0.85; }
footer .houserules b { font-family: var(--display); font-weight: 630; }
footer .colophon { margin-top: 1.5rem; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--meta); }
footer .colophon a { color: var(--meta); }
