/* Freehold — design tokens + shared components
   Lead accent: registry green. Ember is reserved for burn/expiry only. */

:root {
  --paper: #fafaf7;
  --paper-2: #f1f2ec;
  --card: #ffffff;
  --ink: #17211b;
  --ink-2: #4b574f;
  --line: #d9ddd2;
  --green: #1e6b4e;
  --green-soft: #e3efe7;
  --ember: #c24e22;
  --ember-soft: #f7e8e0;
  --radius: 6px;
  --stamp: 4px 4px 0 rgba(23, 33, 27, 0.85);
  --stamp-sm: 3px 3px 0 rgba(23, 33, 27, 0.85);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101613;
    --paper-2: #0b100d;
    --card: #161d18;
    --ink: #e8ece6;
    --ink-2: #9caaa0;
    --line: #2a352d;
    --green: #4cae85;
    --green-soft: #1a2b22;
    --ember: #e37243;
    --ember-soft: #33201a;
    --stamp: 4px 4px 0 rgba(0, 0, 0, 0.6);
    --stamp-sm: 3px 3px 0 rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

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

.display {
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

.mono { font-family: var(--mono); }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font: inherit;
  font-weight: 600;
  padding: 0.55em 1.1em;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--paper-2); }
.btn:active { translate: 2px 2px; box-shadow: none !important; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: var(--stamp-sm);
}
.btn-primary:hover { background: var(--green); filter: brightness(1.08); }

.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: transparent; }

.btn-burn { border-color: var(--ember); color: var(--ember); background: transparent; }
.btn-burn:hover { background: var(--ember-soft); }

.btn-lg { padding: 0.75em 1.4em; font-size: 1.05rem; }
.btn-small { padding: 0.3em 0.75em; font-size: 0.85rem; font-weight: 600; }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55em 0.7em;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green);
  outline: none;
}
.field .hint { font-size: 0.8rem; color: var(--ink-2); margin-top: 0.3rem; font-weight: 400; }

.form-error {
  background: var(--ember-soft);
  border: 1px solid var(--ember);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 2px solid var(--ink);
}
.wordmark {
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .tld { color: var(--green); }
.topbar nav { display: flex; align-items: center; gap: 1.25rem; }
.topbar nav > a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.topbar nav > a:not(.btn):hover { color: var(--ink); }

/* ---------- landing ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--green); }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 34em; margin: 1.25rem 0 1.75rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.fineprint { font-size: 0.85rem; color: var(--ink-2); margin-top: 1rem; }

/* deed card — the signature */

.hero-card { display: grid; gap: 1rem; }
.deed {
  margin: 0;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--stamp);
  padding: 1.1rem 1.2rem;
}
.deed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin-bottom: 0.75rem;
}
.deed-status { color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 0.1em 0.6em; }
.deed-burned .deed-status { color: var(--ember); border-color: var(--ember); }
.deed-addr {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  margin: 0 0 0.9rem;
  overflow-wrap: anywhere;
}
.deed-at { color: var(--green); }
.deed-meta { display: flex; gap: 2rem; margin: 0 0 0.75rem; }
.deed-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.deed-meta dd { margin: 0.1rem 0 0; font-weight: 600; }
.deed-timer { color: var(--ember); }
.deed-fuse {
  height: 6px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-2);
  margin-bottom: 0.9rem;
}
.deed-fuse span { display: block; height: 100%; width: 62%; background: var(--ember); }
.deed-actions { display: flex; gap: 0.5rem; }
.deed-burned { opacity: 0.7; box-shadow: none; border-style: dashed; }
.deed-epitaph { margin: 0; font-size: 0.9rem; color: var(--ink-2); }

/* ledger + covenants */

.how, .covenants { max-width: 1200px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem); }
.how h2, .covenants h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 2rem; }

.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ledger li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.ledger-no {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--green);
  line-height: 1;
}
.ledger h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.ledger p { margin: 0; color: var(--ink-2); max-width: 46em; }

.covenant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.covenant-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--card);
}
.covenant-list .clause {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--green);
  display: block;
  margin-bottom: 0.4rem;
}
.covenant-list h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.covenant-list p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }

.cta-band {
  max-width: 1200px;
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 1.5rem; }

footer {
  border-top: 2px solid var(--ink);
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ink-2);
}
footer a { color: var(--ink-2); }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .topbar nav > a:not(.btn) { display: none; }
}

/* ---------- auth ---------- */

.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  justify-items: center;
}
.auth-card {
  width: min(400px, 92vw);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--stamp);
  padding: 1.5rem;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 0.25rem;
  margin-bottom: 1.25rem;
}
.tabs button {
  font: inherit;
  font-weight: 600;
  padding: 0.45em;
  border: none;
  background: transparent;
  color: var(--ink-2);
  border-radius: 4px;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.auth-note { font-size: 0.82rem; color: var(--ink-2); margin: 1rem 0 0; }
