/* ============================================
   Runtime Atelier — Shared Styles
   ============================================ */

:root {
  --bg: #f4f0e8;
  --bg-alt: #ebe4d6;
  --ink: #1c1a17;
  --ink-soft: #4a463f;
  --rule: #cfc6b3;
  --accent: #a44a2c;
  --accent-soft: #c98c69;
  --max-width: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  opacity: 1;
  transition: opacity .35s ease;
}

/* Hide body until web fonts have loaded (with a 1.5s timeout fallback set in JS) */
html.fonts-loading body { opacity: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--ink); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 1.25rem;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  background: transparent;
  transition: background .3s ease, padding .3s ease, box-shadow .3s ease;
}

.nav.scrolled {
  background: rgba(244, 240, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  box-shadow: 0 1px 0 var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.6rem;
  vertical-align: middle;
  transform: translateY(-2px);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.95rem;
}

.nav-links a { color: var(--ink); }

.nav-cta {
  border: 1px solid var(--ink);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background .2s ease, color .2s ease;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--bg);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem var(--pad);
    border-top: 1px solid var(--rule);
    gap: 1rem;
    display: none;
  }
  .nav.open .nav-links { display: flex; }
}

/* ============================================
   Hero — Case file
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.case-file {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: clamp(2rem, 4.5vw, 3.5rem) clamp(2rem, 5vw, 3.75rem);
  box-shadow: 0 1px 0 var(--rule), 0 30px 60px -40px rgba(28, 26, 23, 0.18);
}

.case-file::before,
.case-file::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: var(--rule);
  opacity: 0.6;
}

.case-file::before { top: 0.5rem; }
.case-file::after  { bottom: 0.5rem; }

.case-file-seal {
  position: absolute;
  top: clamp(1.25rem, 3vw, 2rem);
  right: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-file-seal-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.case-file-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 2rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule);
  max-width: 70%;
}

@media (max-width: 820px) {
  .case-file-header {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .case-file-header { grid-template-columns: 1fr; }
}

.case-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.case-field-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.case-field-value {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.25;
}

.case-file-body h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  margin: 0 0 1.5rem;
}

.hero-lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  max-width: 52ch;
  color: var(--ink);
  margin: 0;
}

.hero-meta {
  display: flex;
  gap: 1.25rem;
  margin-top: 2.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

.case-file-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* ============================================
   Sections
   ============================================ */

section { padding: 6rem 0; }

.section-header {
  max-width: 56ch;
  margin-bottom: 4rem;
}

/* About */

.about {
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
}

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.about-body p {
  font-size: 1.1rem;
  color: var(--ink);
}

.principles {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
}

@media (max-width: 600px) { .principles { grid-template-columns: 1fr; } }

.principles li {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.principles strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.principles span { color: var(--ink-soft); font-size: 0.95rem; }

/* Services overview */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

@media (max-width: 820px) { .services-grid { grid-template-columns: 1fr; } }

.service-card {
  padding: 2.5rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  position: relative;
}

.service-card--bespoke { background: var(--bg-alt); }

.service-card .num {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.service-card h3 { margin-bottom: 1rem; }
.service-card p { margin-bottom: 1.75rem; }

.service-card .arrow {
  margin-top: auto;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 500;
}

.service-card .arrow::after {
  content: "→";
  transition: transform .2s ease;
}

.service-card .arrow:hover::after { transform: translateX(4px); }

/* Contact */

.contact {
  background: var(--ink);
  color: var(--bg);
}

.contact h2 { color: var(--bg); }
.contact p { color: rgba(244, 240, 232, 0.75); }
.contact .eyebrow { color: var(--accent-soft); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.contact-list li {
  padding: 1.25rem 0;
  border-top: 1px solid rgba(244, 240, 232, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-list li:last-child { border-bottom: 1px solid rgba(244, 240, 232, 0.15); }

.contact-list .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-soft);
}

.contact-list .value { color: var(--bg); font-family: var(--serif); font-size: 1.15rem; }
.contact-list a.value:hover { color: var(--accent-soft); }

/* Footer */

.footer {
  background: var(--ink);
  color: rgba(244, 240, 232, 0.6);
  padding: 2rem 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(244, 240, 232, 0.1);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer a { color: rgba(244, 240, 232, 0.6); }
.footer a:hover { color: var(--accent-soft); }

.footer-attribution {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(244, 240, 232, 0.1);
  font-size: 0.78rem;
  color: rgba(244, 240, 232, 0.4);
}

/* ============================================
   Sample report pages
   ============================================ */

.report {
  padding: 7rem 0 4rem;
  background: var(--bg-alt);
}

.report-container {
  max-width: 820px;
}

.report-paper {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: clamp(2rem, 5vw, 4rem) clamp(1.75rem, 5vw, 4rem);
  box-shadow: 0 1px 0 var(--rule), 0 30px 60px -40px rgba(28, 26, 23, 0.18);
  position: relative;
}

.report-paper::before,
.report-paper::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: var(--rule);
  opacity: 0.6;
}

.report-paper::before { top: 0.5rem; }
.report-paper::after  { bottom: 0.5rem; }

.report-tag {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 1.75rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 720px) {
  .report-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .report-meta { grid-template-columns: 1fr; }
}

.report-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 1.5rem;
}

.report-lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

.report-body {
  margin-top: 3rem;
}

.report-body section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

.report-body section:first-child { border-top: 0; padding-top: 1rem; }

.section-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.report-body h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  margin: 0 0 1.25rem;
  max-width: 32ch;
}

.report-body h3 {
  font-size: 1.1rem;
  font-family: var(--serif);
  font-weight: 500;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
}

.report-body p {
  font-size: 1rem;
  color: var(--ink);
  max-width: 64ch;
  margin: 0 0 1em;
}

.report-body p.muted { color: var(--ink-soft); }

.report-body ul,
.report-body ol {
  padding-left: 1.25rem;
  margin: 0 0 1em;
  max-width: 64ch;
}

.report-body li {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.report-body li::marker { color: var(--accent); }

.report-pullquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  max-width: 50ch;
}

.report-footer {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.signature .signature-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.signature .signature-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
}

.back-link {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.back-link:hover { color: var(--accent); }

