:root {
  --paper: #f5efe3;
  --paper-strong: #fffaf0;
  --ink: #171815;
  --muted: #615c51;
  --green: #193d35;
  --green-2: #27584c;
  --blueprint: #173d64;
  --brass: #c78934;
  --plaster: #dfd0b7;
  --line: rgba(23, 24, 21, 0.18);
  --shadow: 0 24px 70px rgba(20, 17, 10, 0.22);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #d7c7a9;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 252, 240, 0.85), transparent 30%),
    linear-gradient(135deg, rgba(49, 82, 69, 0.14), transparent 45%),
    repeating-linear-gradient(90deg, rgba(23,24,21,0.045), rgba(23,24,21,0.045) 1px, transparent 1px, transparent 84px);
  z-index: -1;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  transform: translateY(-130%);
  background: var(--ink);
  color: var(--paper-strong);
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 10;
}
.skip-link:focus { transform: translateY(0); }

.drawing-table {
  min-height: 100svh;
  position: relative;
  padding: clamp(22px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.58fr);
  grid-template-rows: auto auto minmax(160px, 1fr) auto;
  gap: clamp(14px, 2vw, 28px);
  overflow: hidden;
  isolation: isolate;
}
.table-grid {
  position: absolute;
  inset: clamp(12px, 2vw, 28px);
  border: 1px solid rgba(23,24,21,0.18);
  background:
    linear-gradient(90deg, transparent 96%, rgba(23,24,21,0.08) 96%),
    linear-gradient(0deg, transparent 96%, rgba(23,24,21,0.08) 96%);
  background-size: 48px 48px;
  border-radius: 28px;
  opacity: 0.65;
  z-index: -1;
}
.sheet {
  background: linear-gradient(145deg, rgba(255, 250, 240, 0.96), rgba(243, 232, 211, 0.96));
  border: 1px solid rgba(23,24,21,0.22);
  box-shadow: var(--shadow);
}
.sheet-main {
  grid-column: 1 / 2;
  grid-row: 1 / 4;
  align-self: stretch;
  min-height: 560px;
  padding: clamp(26px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 32px 10px 32px 10px;
  position: relative;
  overflow: hidden;
}
.sheet-main::after {
  content: "";
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  bottom: clamp(18px, 4vw, 58px);
  width: min(44vw, 420px);
  height: min(44vw, 420px);
  border: 1px solid rgba(23,24,21,0.1);
  background:
    linear-gradient(90deg, rgba(23,24,21,0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23,24,21,0.1) 1px, transparent 1px);
  background-size: 38px 38px;
  border-radius: 50%;
  opacity: 0.42;
}
.stamp,
.section-marker {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(25,61,53,0.34);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(25,61,53,0.07);
}
h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin: 0;
}
h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  font-size: clamp(4.6rem, 15vw, 13.5rem);
  text-wrap: balance;
}
h2 { font-size: clamp(2.35rem, 7vw, 6.8rem); text-wrap: balance; }
h3 { font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.05; }
.opening-line {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: clamp(20px, 5vw, 48px) 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  color: var(--muted);
}
.sheet-actions,
.form-actions,
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1px solid rgba(23,24,21,0.18);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: var(--paper-strong); border-color: var(--green); }
.btn-secondary { background: rgba(255,250,240,0.62); color: var(--ink); }

.project-rail {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: start;
}
.project-rail a {
  min-height: 48px;
  text-decoration: none;
  background: rgba(25,61,53,0.9);
  color: var(--paper-strong);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(25,61,53,0.16);
}
.photo-plate {
  margin: 0;
  background: var(--paper-strong);
  border: 1px solid rgba(23,24,21,0.18);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.photo-plate img { width: 100%; height: 100%; object-fit: cover; }
.photo-plate figcaption {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 10px 12px;
  background: rgba(255,250,240,0.96);
}
.plate-large {
  grid-column: 2 / 3;
  grid-row: 2 / 4;
  height: min(58vh, 560px);
  border-radius: 18px 42px 18px 42px;
  transform: rotate(1.2deg);
}
.plate-small {
  position: absolute;
  width: min(28vw, 360px);
  min-width: 220px;
  right: min(10vw, 130px);
  bottom: 110px;
  border-radius: 22px;
  transform: rotate(-4deg);
  z-index: 2;
}
.material-strip {
  grid-column: 1 / -1;
  grid-row: 4 / 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(23,24,21,0.18);
  border-radius: 999px;
  background: rgba(255,250,240,0.5);
  backdrop-filter: blur(12px);
  align-self: end;
}
.material-strip span {
  background: var(--paper-strong);
  border: 1px solid rgba(23,24,21,0.14);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  color: var(--green);
}

.brief-studio,
.routebook,
.workbench,
.coverage,
.contact-sheet {
  padding: clamp(52px, 8vw, 112px) clamp(18px, 5vw, 72px);
}
.brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: end;
}
.brief-copy p,
.workbench-head p,
.contact-intro p {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}
.tab-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tab {
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(23,24,21,0.18);
  background: rgba(255,250,240,0.64);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  padding: 14px 16px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.tab:hover { transform: translateY(-2px); }
.tab.is-active { background: var(--green); color: var(--paper-strong); }
.brief-card {
  position: relative;
  border-radius: 36px 16px 36px 16px;
  padding: clamp(22px, 4vw, 46px);
  background: var(--green);
  color: var(--paper-strong);
  min-height: 420px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.brief-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255,250,240,0.3);
  border-radius: 26px 10px 26px 10px;
  pointer-events: none;
}
.brief-card-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.brief-card-head span {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brass);
  color: #20180c;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.brief-card p { color: rgba(255,250,240,0.82); font-size: 1.12rem; }
.brief-card ul { position: relative; z-index: 1; margin: 24px 0 0; padding-left: 20px; }
.brief-card li + li { margin-top: 10px; }

.routebook { background: var(--ink); color: var(--paper-strong); }
.routebook .section-marker { color: var(--paper-strong); border-color: rgba(255,250,240,0.28); background: rgba(255,250,240,0.08); }
.fold-title { display: grid; grid-template-columns: minmax(0, 0.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.route-line {
  margin-top: clamp(30px, 7vw, 80px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--brass);
  gap: 0;
}
.route-line article {
  padding: clamp(18px, 3vw, 34px) clamp(14px, 2.5vw, 28px);
  min-height: 270px;
  border-right: 1px solid rgba(255,250,240,0.18);
  background: linear-gradient(180deg, rgba(255,250,240,0.05), transparent);
}
.route-line article:last-child { border-right: 0; }
.route-line span {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--brass);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.route-line p { color: rgba(255,250,240,0.72); }

.workbench { background: var(--paper); }
.workbench-head {
  display: grid;
  grid-template-columns: minmax(0, 0.22fr) minmax(0, 0.9fr) minmax(260px, 0.55fr);
  gap: clamp(16px, 3vw, 34px);
  align-items: start;
}
.bench-scroll {
  margin-top: clamp(28px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1.4fr repeat(2, minmax(180px, 0.8fr));
  gap: 14px;
}
.bench-item {
  min-width: 0;
  border: 1px solid rgba(23,24,21,0.16);
  background: rgba(255,250,240,0.78);
  padding: 22px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.bench-item:nth-child(2) { border-radius: 54px 16px 16px 16px; }
.bench-item:nth-child(3) { border-radius: 16px 54px 16px 16px; }
.bench-item:nth-child(4) { border-radius: 16px 16px 54px 16px; }
.bench-item:nth-child(5) { border-radius: 16px 16px 16px 54px; }
.bench-item:nth-child(6) { border-radius: 34px; background: var(--blueprint); color: var(--paper-strong); }
.bench-item.wide {
  grid-row: span 2;
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  background: var(--green);
  color: var(--paper-strong);
}
.bench-item.wide img { width: 100%; height: 340px; object-fit: cover; }
.bench-item.wide div { padding: 24px; }
.bench-item p { margin: 12px 0 0; color: var(--muted); }
.bench-item.wide p,
.bench-item:nth-child(6) p { color: rgba(255,250,240,0.78); }

.coverage {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 0.65fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  background: var(--plaster);
}
.coverage ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.coverage li {
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--paper-strong);
  border: 1px solid rgba(23,24,21,0.14);
  font-weight: 900;
  color: var(--green);
}

.contact-sheet {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 0.72fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: start;
  background:
    linear-gradient(90deg, rgba(25,61,53,0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(25,61,53,0.08) 1px, transparent 1px),
    var(--paper-strong);
  background-size: 52px 52px;
}
.trust-lines { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.trust-lines span {
  background: rgba(25,61,53,0.1);
  border: 1px solid rgba(25,61,53,0.18);
  color: var(--green);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 800;
}
.brief-form {
  background: var(--paper);
  border: 1px solid rgba(23,24,21,0.18);
  border-radius: 28px 12px 28px 12px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  display: grid;
  gap: 16px;
}
.field-row { display: grid; gap: 8px; min-width: 0; }
.field-row label { font-weight: 900; color: var(--green); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(23,24,21,0.2);
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 15px;
  padding: 13px 14px;
}
textarea { resize: vertical; min-height: 132px; }
.form-actions { justify-content: flex-end; margin-top: 4px; }
.form-status { margin: 0; color: var(--muted); font-weight: 700; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--ink);
  color: var(--paper-strong);
}
.site-footer div:first-child { display: grid; gap: 4px; }
.site-footer span { color: rgba(255,250,240,0.7); }
.footer-actions a { color: var(--paper-strong); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.js .line-trace {
  animation: trace 700ms ease both;
}
@keyframes trace {
  from { transform: translateY(8px); opacity: 0.82; }
  to { transform: translateY(0); opacity: 1; }
}

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

@media (max-width: 1024px) {
  .drawing-table { grid-template-columns: 1fr; grid-template-rows: auto; }
  .sheet-main, .project-rail, .plate-large, .material-strip { grid-column: 1; grid-row: auto; }
  .sheet-main { min-height: auto; }
  .plate-large { height: 420px; transform: none; }
  .plate-small { position: relative; right: auto; bottom: auto; width: 100%; min-width: 0; transform: none; grid-column: 1; }
  .brief-layout, .coverage, .contact-sheet { grid-template-columns: 1fr; }
  .workbench-head { grid-template-columns: 1fr; }
  .bench-scroll { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench-item.wide { grid-column: 1 / -1; grid-row: auto; }
  .fold-title { grid-template-columns: 1fr; }
  .route-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-line article:nth-child(2) { border-right: 0; }
}

@media (max-width: 620px) {
  body { overflow-x: hidden; }
  .drawing-table { padding: 16px; gap: 12px; }
  .table-grid { inset: 8px; border-radius: 20px; background-size: 36px 36px; }
  .sheet-main { padding: 22px; border-radius: 24px 8px 24px 8px; }
  .sheet-main::after { width: 260px; height: 260px; right: -42px; bottom: -42px; }
  h1 { font-size: clamp(3.2rem, 20vw, 5.4rem); }
  h2 { font-size: clamp(2.1rem, 13vw, 3.6rem); }
  .project-rail, .tab-grid, .bench-scroll, .route-line { grid-template-columns: 1fr; }
  .route-line article { border-right: 0; border-bottom: 1px solid rgba(255,250,240,0.18); min-height: auto; }
  .route-line article:last-child { border-bottom: 0; }
  .material-strip { border-radius: 22px; }
  .material-strip span { flex: 1 1 140px; text-align: center; }
  .brief-studio, .routebook, .workbench, .coverage, .contact-sheet { padding: 44px 16px; }
  .brief-card { min-height: auto; }
  .bench-item { min-height: 180px; }
  .bench-item.wide img { height: 240px; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn, .form-actions button { width: 100%; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 390px) {
  .stamp, .section-marker { font-size: 0.68rem; letter-spacing: 0.1em; padding: 7px 10px; }
  .btn { width: 100%; padding-left: 16px; padding-right: 16px; }
  .sheet-actions { align-items: stretch; }
  .photo-plate figcaption { font-size: 0.84rem; }
  .trust-lines span, .coverage li { width: 100%; }
}
