/* PortaEstate v1. Serious, warm, paper. Mobile first. */

:root {
  --ink: #1a2230;
  --ink-soft: #2c3648;
  --cream: #f4efe6;
  --paper: #fbf8f2;
  --rule: #d4cbb8;
  --muted: #5c6570;
  --accent: #8f4d38;
  --accent-deep: #6e3a2a;
  --good: #2c5340;
  --warn: #8a4b1f;
  --flag: #7a2e2e;
  --focus: #8f4d38;
  --max: 68rem;
  --narrow: 42rem;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --space: clamp(1.25rem, 3vw, 2rem);
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(143, 77, 56, 0.18);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

:focus {
  outline: none;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.wrap,
.wrap-narrow {
  width: 100%;
  margin-inline: auto;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px))
    max(1rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.wrap {
  max-width: var(--max);
}

.wrap-narrow {
  max-width: var(--narrow);
}

/* Header */

.site-header {
  background: var(--ink);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.7rem 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  min-width: 0;
  flex: 1 1 auto;
}

.wordmark .mark {
  color: var(--cream);
  flex: 0 0 auto;
}

.wordmark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.75rem;
  color: #c4b8a4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid #c4b8a4;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  flex: 0 0 auto;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.nav-toggle-bars {
  width: 1rem;
  height: 0.7rem;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: currentColor;
  background-clip: content-box;
  padding: 0.2rem 0;
}

.site-nav {
  flex: 1 1 100%;
  min-width: 0;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.5rem;
  display: flex;
  flex-direction: column;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 239, 230, 0.12);
  padding-inline: 0.15rem;
}

.site-nav a[aria-current="page"] {
  color: #f3d6c8;
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 0.65rem;
}

.site-nav[data-open="false"] {
  display: none;
}

@media (min-width: 800px) {
  .nav-toggle {
    display: none;
  }

  .site-nav,
  .site-nav[data-open="false"] {
    display: block;
    flex: 0 0 auto;
  }

  .site-nav ul {
    flex-direction: row;
    gap: 0.25rem;
    padding: 0;
  }

  .site-nav a {
    border: 0;
    padding: 0 0.8rem;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 0 -2px 0 #f3d6c8;
    padding-left: 0.8rem;
  }
}

/* Hero and page chrome */

.hero {
  background: var(--ink);
  color: var(--cream);
  padding: 2.2rem 0 2.5rem;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  gap: 1.75rem;
}

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b8a4;
  margin: 0 0 0.85rem;
}

.hero h1,
.page-hero h1,
.section h2,
.panel h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.18;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.35rem);
  margin: 0 0 1rem;
  max-width: 18ch;
}

.lede {
  font-size: 1.15rem;
  max-width: 40rem;
  color: #e6dfd2;
  margin: 0 0 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions .btn {
  flex: 1 1 12rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--accent);
  color: #fffaf5;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: #fffaf5;
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: #c4b8a4;
}

.btn-ghost:hover {
  color: #fff;
  border-color: #fff;
}

.btn-ink {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.btn-ink:hover {
  background: var(--ink-soft);
  color: var(--cream);
}

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

.btn-line:hover {
  background: var(--ink);
  color: var(--cream);
}

.binder {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 4px 6px 0 rgba(26, 34, 48, 0.08);
  padding: 1.15rem 1.15rem 1.15rem 1.4rem;
  position: relative;
}

.binder::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.45rem;
  background: var(--accent);
}

.binder h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.tab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
  gap: 1.25rem;
}

.tab-list li {
  break-inside: avoid;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.4rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}

.tab-list .n {
  font-family: var(--font-display);
  color: var(--accent);
}

@media (min-width: 880px) {
  .binder,
  .score-card {
    box-shadow: 8px 10px 0 rgba(26, 34, 48, 0.08);
  }

  .hero {
    background: linear-gradient(
      180deg,
      var(--ink) 0%,
      var(--ink) 14rem,
      var(--cream) 14rem
    );
    padding-bottom: 0;
  }

  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
    padding-bottom: 3rem;
  }

  .tab-list {
    columns: 2;
  }
}

.page-hero {
  padding: 2.4rem 0 1.4rem;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 0 0 0.7rem;
  max-width: 20ch;
}

.page-hero .lede {
  color: var(--ink-soft);
}

.section {
  padding: 2.4rem 0;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.8rem;
}

.section p,
.prose p {
  margin: 0 0 1rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 2rem 0 0.7rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.6rem 0 0.5rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

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

.split {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .split-2 {
    grid-template-columns: 1fr 1fr;
  }

  .split-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.card,
.price,
.flag,
.step {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.25rem;
}

.card h3,
.price h3,
.step h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

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

.note {
  font-size: 0.95rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout {
  background: #efe4d4;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.1rem;
}

.callout strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

/* How it works tabs */

.tab-detail {
  display: grid;
  gap: 0.75rem;
}

.tab-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}

.tab-row .n {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
}

.tab-row h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
}

.tab-row p {
  margin: 0;
  color: var(--ink-soft);
}

/* Pricing */

.price .amt {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0.2rem 0 0.7rem;
}

.price .amt span {
  font-size: 1rem;
  color: var(--muted);
}

/* Score */

.score-shell {
  padding: 1.5rem 0 3rem;
}

.progress {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}

.progress-track {
  height: 6px;
  background: #e4d9c8;
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.score-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.3rem 1.2rem 1.5rem;
  box-shadow: 4px 6px 0 rgba(26, 34, 48, 0.06);
}

.score-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin: 0 0 0.6rem;
}

.choice-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--rule);
  background: #fffdf8;
  cursor: pointer;
}

.choice-list label:hover {
  border-color: var(--ink);
}

.choice-list input {
  margin-top: 0.3rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.choice-list label:has(input:checked) {
  border-color: var(--accent);
  background: #f8eee7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.score-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0;
}

.field label {
  font-weight: 600;
}

.field input[type="text"] {
  min-height: 48px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  background: #fffdf8;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

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

.result-score {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.result-score .num {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
}

.result-score .of {
  color: var(--muted);
}

.flags {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.flags li {
  border-left: 4px solid var(--flag);
  background: #f8ece9;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
}

.in-place li {
  border-left-color: var(--good);
  background: #eef4ef;
}

.letter {
  background: #fffdf8;
  border: 1px solid var(--rule);
  padding: 1.4rem 1.3rem;
  font-size: 0.98rem;
}

.letter h2 {
  font-family: var(--font-display);
  margin: 0 0 0.2rem;
}

.letter .letter-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.letter h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 1.1rem 0 0.35rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: #e6dfd2;
  padding: 2.4rem 0 max(2rem, env(safe-area-inset-bottom, 0px));
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.6rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin: 0 0 0.4rem;
}

.footer-lede {
  color: var(--cream);
}

.footer-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4b8a4;
  margin: 0 0 0.45rem;
}

.footer-links {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.footer-links a,
.site-footer a {
  color: #f3d6c8;
}

.footer-disclaimers {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid #364155;
  font-size: 0.92rem;
}

.footer-disclaimers ol {
  padding-left: 1.15rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.3fr 0.7fr 1fr;
  }
}

/* Print: letter only */

@media print {
  .skip,
  .site-header,
  .site-footer,
  .score-nav,
  .hero-actions,
  .nav-toggle,
  .no-print,
  .progress,
  .progress-track {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 12pt;
  }

  .score-card,
  .letter,
  .binder,
  .card {
    box-shadow: none;
    border-color: #bbb;
  }

  .letter {
    padding: 0;
    border: 0;
  }

  a[href^="mailto:"],
  a[href^="http"] {
    text-decoration: none;
    color: inherit;
  }

  a[href^="mailto:"]::after,
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }

  @page {
    margin: 0.75in;
  }
}

@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;
  }

  .progress-bar {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --rule: #6b6458;
    --muted: #3d4450;
  }

  .btn-primary {
    background: #6e3a2a;
  }
}

@media print {
  .page-hero,
  .score-shell .note,
  .score-card > :not(.letter) {
    display: none !important;
  }

  main {
    margin: 0;
    padding: 0;
  }

  .score-shell,
  .score-card {
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }
}

