/* Form 8130 / Integrity Log — Tropic Airpower
   Paper cream · carbon · inspection stamp green
   Type: Special Elite, Courier Prime, EB Garamond, Libre Baskerville */

:root {
  --paper: #f3ead6;
  --paper-deep: #e8dcc0;
  --carbon: #2a2926;
  --carbon-soft: #4a4740;
  --stamp: #1f6b45;
  --stamp-ink: #174f34;
  --stamp-wash: rgba(31, 107, 69, 0.12);
  --rule: rgba(42, 41, 38, 0.22);
  --desk: #1a1714;
  --folder: #3d3428;
  --accent-ink: #8b1e1e;
  --safe: max(1rem, env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--carbon);
  font-family: "EB Garamond", "Libre Baskerville", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  padding: .5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ========== COVER ========== */
.cover {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem calc(5rem + var(--safe));
  position: relative;
  background:
    radial-gradient(ellipse at 50% 30%, #2a241c 0%, var(--desk) 65%),
    var(--desk);
}

.desk {
  width: min(520px, 100%);
  perspective: 1200px;
}

.folder {
  position: relative;
  background: var(--folder);
  border-radius: 2px 2px 4px 4px;
  padding: 1.1rem 1rem 1.4rem;
  box-shadow:
    0 30px 60px rgba(0,0,0,.55),
    0 2px 0 rgba(255,255,255,.06) inset;
  transform-origin: 50% 100%;
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s;
}

.folder.is-opening {
  transform: translateY(-8%) rotateX(8deg) scale(.96);
  opacity: .35;
  pointer-events: none;
}

.folder-tab {
  position: absolute;
  top: -18px;
  left: 18px;
  background: #4a3f31;
  color: #d4c4a8;
  font-family: "Courier Prime", "Special Elite", monospace;
  font-size: .58rem;
  letter-spacing: .08em;
  padding: .35rem .7rem .25rem;
  border-radius: 3px 3px 0 0;
  text-transform: uppercase;
}

.cover-sheet {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(42,41,38,.06) 28px,
      rgba(42,41,38,.06) 29px
    ),
    linear-gradient(180deg, #f7f0de 0%, var(--paper) 40%, var(--paper-deep) 100%);
  padding: 1.75rem 1.4rem 2.2rem;
  min-height: 420px;
  position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset;
  /* paper fiber */
  background-blend-mode: multiply, normal;
}

.cover-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.cov-meta {
  font-family: "Courier Prime", monospace;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--carbon-soft);
  margin: 0 0 1.25rem;
}

.cover-sheet h1 {
  font-family: "Libre Baskerville", "EB Garamond", serif;
  font-weight: 700;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 .5rem;
  letter-spacing: -.02em;
}

.cov-sub {
  font-family: "Special Elite", monospace;
  font-size: .95rem;
  margin: 0 0 1.5rem;
  color: var(--stamp-ink);
}

.cov-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
  margin: 0 0 2rem;
  padding: 0;
}
.cov-facts div {
  border-top: 1px solid var(--rule);
  padding-top: .4rem;
}
.cov-facts dt {
  font-family: "Courier Prime", monospace;
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--carbon-soft);
  margin: 0;
}
.cov-facts dd {
  margin: .15rem 0 0;
  font-family: "Special Elite", monospace;
  font-size: .95rem;
}

.cov-hint {
  font-family: "Courier Prime", monospace;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--carbon-soft);
  margin: 0;
  animation: pulseHint 2.4s ease-in-out infinite;
}
@keyframes pulseHint {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cov-hint { animation: none; opacity: .75; }
}

/* Rubber stamp button */
.rubber-stamp {
  position: absolute;
  right: 8%;
  bottom: 14%;
  width: 128px;
  height: 128px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  transform: rotate(14deg);
  transition: transform .2s ease, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.rubber-stamp:hover,
.rubber-stamp:focus-visible {
  transform: rotate(10deg) scale(1.06);
  outline: none;
  filter: drop-shadow(0 4px 8px rgba(31,107,69,.35));
}
.rubber-stamp:active { transform: rotate(16deg) scale(.94); }

.stamp-ring {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 4px solid var(--stamp);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31,107,69,.08), transparent 70%);
  box-shadow:
    0 0 0 2px rgba(31,107,69,.25),
    inset 0 0 0 1px rgba(31,107,69,.4);
}
.stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--stamp);
  font-family: "Special Elite", monospace;
  line-height: 1.15;
  text-transform: uppercase;
}
.stamp-top { font-size: .62rem; letter-spacing: .18em; }
.stamp-code { font-size: .95rem; font-weight: 700; letter-spacing: .04em; margin: .2rem 0; }
.stamp-bot { font-size: .58rem; letter-spacing: .2em; }

.rubber-stamp.is-slamming .stamp-ring {
  animation: stampSlam .45s cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes stampSlam {
  0% { transform: scale(1.35); opacity: .3; filter: blur(2px); }
  55% { transform: scale(.92); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; }
}

.perforation {
  position: absolute;
  left: 0; right: 0; bottom: 42px;
  height: 8px;
  background:
    radial-gradient(circle, var(--folder) 2.5px, transparent 2.6px) 0 0 / 12px 8px;
  opacity: .9;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}
.cover-sheet .perforation { display: none; }

.cover-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  justify-content: center;
  padding: .85rem 1rem calc(.85rem + var(--safe));
  background: linear-gradient(transparent, rgba(26,23,20,.92) 30%);
  font-family: "Courier Prime", monospace;
  font-size: .8rem;
  z-index: 20;
}
.cover-cta a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(243,234,214,.35);
  padding-bottom: 1px;
}
.cover-cta a:hover { border-color: #fff; }
.cover-cta .back { opacity: .65; }

body.is-open .cover { display: none; }
body.is-open .cover-cta { display: none; }

/* ========== PACKET ========== */
.packet {
  min-height: 100dvh;
  background:
    repeating-linear-gradient(
      90deg,
      #2a2520 0 1px,
      transparent 1px 80px
    ),
    #231f1a;
}

.packet[hidden] { display: none !important; }

.packet-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .55rem .85rem;
  background: rgba(243, 234, 214, .94);
  border-bottom: 2px solid var(--stamp);
  backdrop-filter: blur(8px);
  font-family: "Courier Prime", monospace;
  font-size: .72rem;
}
.bar-left { display: flex; align-items: center; gap: .5rem; }
.bar-brand { font-family: "Special Elite", monospace; font-size: .85rem; }
.bar-chip {
  border: 1.5px solid var(--stamp);
  color: var(--stamp-ink);
  padding: .15rem .4rem;
  border-radius: 2px;
  letter-spacing: .06em;
  font-size: .65rem;
}
.bar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  flex: 1;
  justify-content: center;
}
.bar-nav button {
  font-family: "Courier Prime", monospace;
  font-size: .62rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: var(--carbon-soft);
  padding: .3rem .45rem;
  cursor: pointer;
  border-radius: 2px;
}
.bar-nav button.is-active,
.bar-nav button:hover {
  border-color: var(--stamp);
  color: var(--stamp-ink);
  background: var(--stamp-wash);
}
.bar-right { display: flex; gap: .75rem; }
.bar-right a {
  color: var(--carbon);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1.5px solid var(--stamp);
}
@media (max-width: 720px) {
  .bar-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .bar-nav button { white-space: nowrap; }
}

/* Spreads — scroll snap */
.spreads {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: calc(100dvh - 52px);
  height: calc(100vh - 52px);
  -webkit-overflow-scrolling: touch;
}
@media (prefers-reduced-motion: reduce) {
  .spreads { scroll-snap-type: none; }
}

.spread {
  scroll-snap-align: start;
  min-height: calc(100dvh - 52px);
  min-height: calc(100vh - 52px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 1rem;
  align-content: center;
}
@media (min-width: 900px) {
  .spread:not(.process-spread) {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem 2rem;
  }
  .spread .page.full { grid-column: 1 / -1; }
}

.page {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(42,41,38,.055) 27px,
      rgba(42,41,38,.055) 28px
    ),
    linear-gradient(175deg, #f8f1e0, var(--paper) 50%, var(--paper-deep));
  padding: clamp(1.25rem, 3vw, 2rem);
  position: relative;
  box-shadow:
    0 12px 40px rgba(0,0,0,.35),
    0 0 0 1px rgba(42,41,38,.08);
  /* slight page curl feel */
  border-radius: 1px;
}
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.page.full { width: 100%; }

.page-num {
  font-family: "Courier Prime", monospace;
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--carbon-soft);
  margin: 0 0 1rem;
}
.right-align { text-align: right; }

.display {
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  letter-spacing: -.02em;
}
.display.sm { font-size: clamp(1.55rem, 3.5vw, 2.2rem); }

.serif-lede, .body {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 38em;
}
.serif-lede em, .body em { font-style: italic; color: var(--stamp-ink); }
.body.narrow { max-width: 36em; }

.carbon-note {
  font-family: "Courier Prime", monospace;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--carbon-soft);
  border-left: 3px solid var(--stamp);
  padding-left: .85rem;
  margin: 1.25rem 0 0;
}

.tick-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.tick-list li {
  position: relative;
  padding: .55rem 0 .55rem 1.6rem;
  border-bottom: 1px dashed var(--rule);
  font-family: "Special Elite", monospace;
  font-size: .92rem;
}
.tick-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--stamp);
  font-weight: 700;
}

.pull {
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.35;
  margin: 0 0 1.25rem;
  color: var(--stamp-ink);
  border: none;
  padding: 0;
}

figure { margin: 0; position: relative; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(.18) contrast(1.05);
  border: 1px solid rgba(42,41,38,.2);
}
figcaption {
  font-family: "Courier Prime", monospace;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: .45rem;
  color: var(--carbon-soft);
}
.inline-fig { margin-top: 1rem; }
.wide-fig { margin-top: 1.5rem; max-width: 720px; }
.photo-page { display: flex; flex-direction: column; justify-content: center; }

.margin-stamp {
  position: absolute;
  right: 1.2rem;
  bottom: 1.5rem;
  width: 100px;
  height: 100px;
  border: 3px solid var(--stamp);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--stamp);
  font-family: "Special Elite", monospace;
  font-size: .72rem;
  text-align: center;
  line-height: 1.2;
  letter-spacing: .06em;
  transform: rotate(-18deg);
  background: var(--stamp-wash);
  opacity: 0;
}
.margin-stamp.stamped { opacity: .85; }
.margin-stamp span { display: block; }

.spec-block {
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.25);
  margin-top: 1rem;
}
.spec-block h3 {
  font-family: "Special Elite", monospace;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .65rem;
  color: var(--stamp-ink);
}
.spec-block ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .98rem;
}
.spec-block li { margin-bottom: .35rem; }
.fine {
  font-family: "Courier Prime", monospace;
  font-size: .7rem;
  color: var(--carbon-soft);
  margin: .75rem 0 0;
}

.rubber-note {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 2px dashed var(--stamp);
  background: var(--stamp-wash);
  font-family: "Special Elite", monospace;
  font-size: .88rem;
  line-height: 1.45;
}

/* Process stamp rail */
.process-head { margin-bottom: 1.25rem; }
.stamp-rail {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .stamp-rail { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .stamp-rail { grid-template-columns: 1fr 1fr 1fr; }
}

.stage {
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.2);
  padding: .85rem;
  display: grid;
  gap: .55rem;
  transition: background .3s, border-color .3s;
}
.stage.is-current {
  border-color: var(--stamp);
  background: rgba(31,107,69,.06);
}
.stage.is-done {
  border-color: var(--stamp-ink);
  background: var(--stamp-wash);
}

.stage-stamp {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
}
.st-label {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2.5px solid var(--carbon-soft);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Special Elite", monospace;
  font-size: .85rem;
  color: var(--carbon-soft);
  transition: border-color .3s, color .3s, background .3s, transform .35s;
}
.stage.is-done .st-label,
.stage.is-current .st-label {
  border-color: var(--stamp);
  color: var(--stamp);
}
.stage.is-done .st-label {
  background: var(--stamp);
  color: var(--paper);
  transform: rotate(-8deg);
  box-shadow: 0 0 0 3px var(--stamp-wash);
}
.st-title {
  font-family: "Special Elite", monospace;
  font-size: .95rem;
}
.st-copy {
  margin: 0;
  font-size: .92rem;
  color: var(--carbon-soft);
  padding-left: calc(52px + .75rem);
}
@media (max-width: 480px) {
  .st-copy { padding-left: 0; }
}

.process-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
}
.ink-btn {
  font-family: "Special Elite", monospace;
  font-size: .95rem;
  background: var(--stamp);
  color: var(--paper);
  border: none;
  padding: .7rem 1.2rem;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 2px 3px 0 var(--stamp-ink);
}
.ink-btn:hover { filter: brightness(1.08); }
.ink-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--stamp-ink); }
.ghost-btn {
  font-family: "Courier Prime", monospace;
  font-size: .8rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--carbon-soft);
  padding: .55rem .9rem;
  cursor: pointer;
}
.process-status {
  font-family: "Courier Prime", monospace;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--stamp-ink);
  margin: 0;
  flex: 1;
  min-width: 12rem;
}

/* Services */
.svc-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: 1fr;
  margin: 1rem 0 0;
}
@media (min-width: 600px) {
  .svc-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .svc-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.svc {
  border-top: 2px solid var(--stamp);
  padding: .75rem 0 .5rem;
}
.svc h3 {
  font-family: "Special Elite", monospace;
  font-size: 1rem;
  margin: 0 0 .35rem;
}
.svc p {
  margin: 0 0 .5rem;
  font-size: .95rem;
  color: var(--carbon-soft);
}
.svc a, .multi-links a {
  font-family: "Courier Prime", monospace;
  font-size: .78rem;
  color: var(--stamp-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--stamp);
}
.multi-links { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Contact / signoff */
.contact-block { margin-top: 1.5rem; }
.big-link {
  font-family: "Special Elite", monospace;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  color: var(--carbon);
  text-decoration: none;
  border-bottom: 2px solid var(--stamp);
}
.addr { margin-top: 1rem; }
.addr a {
  font-family: "Courier Prime", monospace;
  font-size: .9rem;
  color: var(--carbon-soft);
  text-decoration: none;
  line-height: 1.5;
}
.addr a:hover { color: var(--stamp-ink); }

.signoff { display: flex; flex-direction: column; justify-content: center; }
.sign-box {
  border: 2px solid var(--carbon);
  padding: 1.5rem 1.25rem 2rem;
  position: relative;
  background: rgba(255,255,255,.3);
  min-height: 260px;
}
.sign-label {
  font-family: "Courier Prime", monospace;
  font-size: .65rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 .5rem;
}
.sign-code {
  font-family: "Special Elite", monospace;
  font-size: 2rem;
  color: var(--stamp-ink);
  margin: 0 0 .35rem;
  letter-spacing: .06em;
}
.sign-name {
  font-family: "EB Garamond", serif;
  font-style: italic;
  margin: 0;
}
.final-stamp {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 120px;
  height: 120px;
  border: 3.5px solid var(--stamp);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--stamp);
  font-family: "Special Elite", monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  line-height: 1.25;
  transform: rotate(12deg);
  background: var(--stamp-wash);
  box-shadow: inset 0 0 0 2px rgba(31,107,69,.25);
}

.spread-hint {
  position: fixed;
  bottom: .5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Courier Prime", monospace;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(243,234,214,.45);
  pointer-events: none;
  z-index: 25;
  display: none;
}
body.is-open .spread-hint { display: block; }
@media (max-width: 700px) {
  .spread-hint { bottom: calc(.35rem + env(safe-area-inset-bottom)); }
}

/* Slam flash overlay */
.ink-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at var(--sx, 70%) var(--sy, 60%), rgba(31,107,69,.25), transparent 45%);
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  transition: opacity .35s;
}
.ink-flash.on { opacity: 1; }
