:root {
  --bg: #f3efe6;
  --surface: #faf7f0;
  --ink: #28241f;
  --muted: #655b4f;
  --line: #ddd2c2;
  --accent: #b75b2d;
  --accent-dark: #7f3f21;
  --slate: #475056;
  --shadow: 0 24px 55px rgba(63, 43, 26, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(183, 91, 45, 0.07), transparent 18rem),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.topbar {
  border-bottom: 1px solid rgba(40, 36, 31, 0.08);
  background: rgba(250, 247, 240, 0.94);
  backdrop-filter: blur(16px);
}

.topbar-shell,
.page-shell,
.footer {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
}

.topbar-shell {
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #504137 0%, #b75b2d 100%);
  color: #fff7ef;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: flex-end;
}

.main-nav a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
}

.main-nav a.active,
.main-nav a:hover {
  background: rgba(183, 91, 45, 0.1);
  color: var(--accent-dark);
}

.page-shell {
  padding: 2rem 0 3rem;
}

.page-intro {
  margin-bottom: 1.35rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.97;
}

.lead {
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.workbook-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: 1.4rem;
}

.main-sheet,
.side-card,
.hero-copy,
.hero-media,
.result-card,
.content-card,
.sub-card {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.main-sheet {
  padding: 1.5rem;
}

.side-sheet {
  display: grid;
  gap: 1rem;
  align-self: start;
}

.side-card {
  padding: 1.2rem;
}

.side-card ul,
.content-card ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.7rem;
}

.side-card li,
.content-card li,
.content-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
}

.hero-copy,
.hero-media,
.content-card,
.sub-card {
  padding: 1.45rem;
}

.hero-media {
  overflow: hidden;
  min-height: 18rem;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calc-form,
.mini-form {
  display: grid;
  gap: 0.9rem;
}

.calc-form label,
.mini-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.calc-form input,
.calc-form select,
.mini-form input,
.mini-form select {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #ccbfae;
  border-radius: 0.95rem;
  background: #fff;
  font: inherit;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

button {
  border: none;
  border-radius: 0.95rem;
  padding: 0.9rem 1.15rem;
  font: inherit;
  cursor: pointer;
}

.solid-action {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff7ef;
}

.ghost-action {
  background: #ede3d7;
  color: var(--ink);
}

.result-grid,
.content-grid,
.sub-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-card {
  min-height: 8.7rem;
  padding: 1.05rem;
}

.result-card span,
.result-card small {
  display: block;
  color: var(--muted);
}

.result-card strong {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 1.9rem;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(40, 36, 31, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-grid {
  display: grid;
  gap: 0.8rem;
}

.link-grid a {
  min-height: 3rem;
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  background: rgba(71, 80, 86, 0.08);
}

.link-grid a:hover {
  background: rgba(183, 91, 45, 0.12);
}

.footer {
  padding: 1rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .workbook-shell,
  .hero-grid,
  .result-grid,
  .content-grid,
  .sub-grid {
    grid-template-columns: 1fr;
  }
}
