/* The Architect's Method — printable worksheets
   Drafting-table aesthetic: cool paper, steel-blue rules, literary serif titles. */

:root {
  --ink: #15202b;
  --muted: #4a5a6a;
  --rule: #3a5f7a;
  --rule-light: #b8c9d6;
  --paper: #eef2f5;
  --sheet: #fbfcfd;
  --stamp: #7a2e3a;
  --gate: #1e3a4c;
  --focus: #2f6f8f;
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #d9e2ea 0%, var(--paper) 28%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 23px,
      rgba(58, 95, 122, 0.04) 23px,
      rgba(58, 95, 122, 0.04) 24px
    );
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}

h1, h2, .display {
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--rule); }

.sheet-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
}

.sheet-banner button,
.cta {
  font: 500 0.9rem/1 "IBM Plex Sans", sans-serif;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.sheet-banner button:hover,
.cta:hover { background: var(--ink); color: var(--sheet); }

.sheet {
  max-width: 52rem;
  margin: 1rem auto 3rem;
  padding: 1.75rem 1.75rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule-light);
  box-shadow:
    0 0 0 1px rgba(58, 95, 122, 0.08),
    0 18px 40px rgba(21, 32, 43, 0.08);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stamp {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.45rem;
  border: 1.5px solid var(--stamp);
  color: var(--stamp);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--ink);
}

.meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.lede {
  margin: 0 0 0.75rem;
  color: var(--ink);
  max-width: 42rem;
}

.lede.strong {
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  border-left: 3px solid var(--rule);
  padding-left: 0.85rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin: 0.65rem 0;
  font-size: 0.92rem;
}

label.block span { display: block; margin-bottom: 0.35rem; }

.row {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.row.triple { grid-template-columns: repeat(3, 1fr); }
.row.double { grid-template-columns: 1fr 1fr; }

@media (max-width: 640px) {
  .row.triple, .row.double { grid-template-columns: 1fr; }
}

input[type="text"],
textarea {
  width: 100%;
  margin-top: 0.25rem;
  border: none;
  border-bottom: 1px solid var(--rule-light);
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 0.35rem 0;
  border-radius: 0;
}

textarea {
  border: 1px solid var(--rule-light);
  padding: 0.5rem 0.55rem;
  resize: vertical;
  min-height: 3.5rem;
  background:
    repeating-linear-gradient(
      transparent,
      transparent 1.35rem,
      rgba(58, 95, 122, 0.08) 1.35rem,
      rgba(58, 95, 122, 0.08) calc(1.35rem + 1px)
    );
  line-height: 1.45rem;
}

input[type="text"]:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

fieldset.checks {
  border: 1px solid var(--rule-light);
  margin: 0.9rem 0;
  padding: 0.65rem 0.85rem 0.35rem;
}

fieldset.checks legend {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.35rem;
  color: var(--rule);
}

fieldset.checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0.85rem 0.45rem 0;
}

.hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }

.gate {
  margin-top: 1.5rem;
  padding: 1rem 1rem 0.75rem;
  border-top: 2px solid var(--gate);
  background: linear-gradient(180deg, rgba(30, 58, 76, 0.06), transparent 70%);
}

.gate h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--gate);
}

.gate p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.88rem; }

.gate label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.4rem 0;
}

table.fill {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.85rem;
}

table.fill th,
table.fill td {
  border: 1px solid var(--rule-light);
  padding: 0.45rem 0.5rem;
  vertical-align: top;
}

table.fill th {
  background: rgba(58, 95, 122, 0.08);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  text-align: left;
}

table.fill td { height: 2rem; }

.sheet-foot {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule-light);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Landing */
.landing {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
}

.landing h1 {
  font-size: clamp(2rem, 5vw, 2.85rem);
  margin: 0.2rem 0 0.75rem;
  line-height: 1.15;
}

.landing .sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.ws-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  border-top: 1px solid var(--rule-light);
}

.ws-list li {
  border-bottom: 1px solid var(--rule-light);
}

.ws-list a {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.85rem 0.15rem;
  text-decoration: none;
  color: inherit;
}

.ws-list a:hover { color: var(--rule); }

.ws-list .n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--rule);
}

.ws-list .t { font-family: "Libre Baskerville", Georgia, serif; font-size: 1.05rem; }
.ws-list .s { font-size: 0.8rem; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 2rem; }

.note {
  font-size: 0.9rem;
  color: var(--muted);
  border-left: 3px solid var(--rule);
  padding-left: 0.85rem;
}

/* Access gate */
.gate-panel {
  max-width: 28rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
}

.gate-form {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.gate-form label {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.gate-form input[type="email"],
.gate-form input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--rule-light);
  background: var(--sheet);
  padding: 0.55rem 0.65rem;
}

.gate-form .hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.gate-rule {
  border: none;
  border-top: 1px solid var(--rule-light);
  margin: 1.5rem 0;
}

.gate-status {
  min-height: 1.25rem;
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.gate-status[data-kind="ok"] { color: #1e5a3a; }
.gate-status[data-kind="error"] { color: var(--stamp); }
.gate-status[data-kind="pending"] { color: var(--rule); }

html.ws-locked #ws-content { display: none !important; }
html.ws-unlocked #ws-gate { display: none !important; }

@page {
  size: A4;
  margin: 12mm 14mm;
}

@media print {
  body {
    background: white;
  }
  .no-print { display: none !important; }
  .sheet {
    box-shadow: none;
    border: none;
    margin: 0;
    max-width: none;
    page-break-after: always;
    break-after: page;
  }
  .sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  input, textarea {
    border-color: #999 !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  h2 { break-after: avoid; }
  .gate { break-inside: avoid; }
}
