/* =========================================================
   EUCLID-EAN — Spatial Design • Build
   Design tokens
   ========================================================= */

:root {
  --bg: #EDE6D8;          /* warm linen */
  --bg-deep: #24211A;     /* warm charcoal, dark sections */
  --paper: #F6F1E6;       /* lighter card surface */
  --ink: #35321F;         /* primary text, warm umber-black */
  --ink-soft: #6B6650;    /* secondary text */
  --rust: #9B4F29;        /* burnt terracotta accent — darkened from #A6572E for WCAG AA contrast on --bg */
  --clay: #8B6F52;        /* muted clay — primary button hover, matches contact.html's Send Enquiry */
  --sage: #6B7156;        /* olive sage, echoes wordmark */
  --ochre: #C89A5B;       /* hairline / construction-line gold */
  --line: rgba(53, 50, 31, 0.16);

  --display: "Playfair Display", "Iowan Old Style", serif;
  --body: "Jost", "Helvetica Neue", sans-serif;

  --max: 1180px;
}

* { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 40px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  font-variant-ligatures: none;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; font-weight: 460; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 480; }
h3 { font-size: 1.3rem; font-weight: 500; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--rust);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.4px solid var(--rust);
  display: inline-block;
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}

/* The frosted-glass effect lives on this pseudo-element rather than
   directly on .site-header. A backdrop-filter on an ancestor becomes
   the "containing block" for any position:fixed descendant inside it
   — which was breaking the full-screen mobile nav overlay (it was
   anchoring to the header instead of the viewport). Pseudo-elements
   have no children, so this keeps the same visual blur with none of
   that side effect. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(237, 230, 216, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  max-width: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img { height: 42px; width: auto; }

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 34px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 4px;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--ink);
}

nav.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--rust);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 1.4px;
  background: var(--ink);
  display: block;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--ink);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--clay); border-color: var(--clay); }

.btn-on-dark {
  border-color: rgba(246, 241, 230, 0.5);
  color: var(--paper);
}
.btn-on-dark:hover { border-color: var(--ochre); color: var(--ochre); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 90px 0 110px;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero-copy p.lede {
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 22px 0 34px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-diagram {
  position: relative;
  aspect-ratio: 1 / 1;
}

.hero-diagram svg { width: 100%; height: 100%; }

.hero-diagram .construct-path {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.2;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.6s ease forwards 0.3s;
}
.hero-diagram .construct-path.alt {
  stroke: var(--rust);
  animation-delay: 0.9s;
}
.hero-diagram .construct-dot {
  fill: var(--ink);
  opacity: 0;
  animation: fadeIn 0.6s ease forwards 2.4s;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero-diagram .construct-path { animation: none; stroke-dashoffset: 0; }
  .hero-diagram .construct-dot { animation: none; opacity: 1; }
}

/* ---------- generic sections ---------- */

section { padding: 96px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 { margin-top: 10px; }

.dark {
  background: var(--bg-deep);
  color: var(--paper);
}
.dark h1, .dark h2, .dark h3 { color: var(--paper); }
.dark p { color: rgba(246, 241, 230, 0.72); }

.paper {
  background: var(--paper);
}

/* ---------- grids ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
}

.card {
  padding-top: 4px;
}

.card .num {
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--rust);
}

.card h3 { margin: 14px 0 10px; }

.card p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- portfolio page: carousel cards ---------- */

.proj-card {
  display: flex;
  flex-direction: column;
}

.proj-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
}

.proj-photo .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.proj-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(246, 241, 230, 0.28);
  background: rgba(20, 18, 14, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  color: transparent;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  z-index: 2;
}
.proj-arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.6px solid var(--paper);
  border-right: 1.6px solid var(--paper);
  display: block;
}
.proj-arrow.prev::before { transform: rotate(-135deg); margin-left: 4px; }
.proj-arrow.next::before { transform: rotate(45deg); margin-right: 4px; }
.proj-arrow:hover {
  background: rgba(20, 18, 14, 0.66);
  border-color: rgba(246, 241, 230, 0.5);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.proj-arrow.prev { left: 14px; }
.proj-arrow.next { right: 14px; }

/* Grid-card arrows: hidden until the photo is hovered */
.proj-photo .proj-arrow {
  opacity: 0;
  transition: opacity 0.2s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.proj-photo:hover .proj-arrow {
  opacity: 1;
}

.proj-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.proj-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(246, 241, 230, 0.5);
  cursor: pointer;
}
.proj-dots .dot.active { background: var(--paper); }

.proj-caption {
  padding: 18px 2px 0;
  cursor: pointer;
}
.proj-caption h3 { font-size: 1.15rem; margin-bottom: 4px; }
.proj-caption .cat {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- portfolio ---------- */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.portfolio-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  align-items: flex-end;
}

.portfolio-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0) 65%);
  pointer-events: none;
}

.portfolio-item .plan {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portfolio-item .tag {
  position: relative;
  z-index: 2;
  padding: 26px;
  color: var(--paper);
}

.portfolio-item .tag .eyebrow { color: var(--ochre); }
.portfolio-item .tag h3 { margin-top: 6px; }

/* ---------- process list ---------- */

.process {
  display: grid;
  gap: 0;
}
.process-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 30px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.process-item:last-child { border-bottom: 1px solid var(--line); }

.process-item .mark {
  font-family: var(--display);
  font-style: italic;
  color: var(--sage);
  font-size: 1.1rem;
  padding-top: 3px;
}

.process-item h3 { margin-bottom: 10px; }
.process-item p { color: var(--ink-soft); max-width: 56ch; }

/* ---------- quote / pull ---------- */

.pull {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.4;
  max-width: 780px;
  color: var(--ink);
}

/* ---------- footer ---------- */

footer.site-footer {
  background: var(--bg-deep);
  color: rgba(246, 241, 230, 0.75);
  padding: 34px 0 18px;
  border-top: 1px solid rgba(246, 241, 230, 0.12);
}

footer.site-footer .wrap {
  max-width: none;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(246, 241, 230, 0.14);
}

.footer-top .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: auto;
  flex: 0 0 auto;
  align-self: center;
}
.footer-top .brand img {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 16px 0;
}
.footer-top .brand p {
  margin: 0;
  font-size: 0.85rem;
  max-width: 34ch;
}

.footer-col p { font-size: 0.8rem; line-height: 1.6; margin: 0 0 8px; color: rgba(246, 241, 230, 0.65); }
.footer-col p:last-child { margin-bottom: 0; }
.footer-col p a { display: block; margin-bottom: 8px; }
.footer-col p a:last-child { margin-bottom: 0; }

.footer-col h4 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 10px;
  font-weight: 500;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.footer-col a { font-size: 0.8rem; }
.footer-col a:hover { color: var(--ochre); }

.footer-ig {
  margin-top: 18px;
}

.footer-ig-grid {
  display: flex;
  gap: 4px;
}

.footer-ig-item {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  flex: none;
  background-color: rgba(246, 241, 230, 0.06);
  overflow: hidden;
}

.footer-ig-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0);
  transition: background 0.2s ease;
}

.footer-ig-item:hover::after {
  background: rgba(20, 18, 14, 0.28);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: rgba(246, 241, 230, 0.5); /* was 0.45 — bumped for WCAG AA contrast on --bg-deep */
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-diagram { max-width: 340px; margin: 0 auto; }
  .grid-3 { grid-template-columns: 1fr; gap: 40px; }
  .grid-2 { grid-template-columns: 1fr; gap: 36px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; gap: 44px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 24px; }
  /* Footer brand (logo + tagline): centered on mobile by design,
     while the Contact/Follow columns beside it stay left-aligned.
     Scoped to mobile only — desktop keeps its left-aligned row layout. */
  .footer-top .brand {
    align-self: center;
    align-items: center;
    text-align: center;
  }

  nav.main-nav {
    position: fixed;
    top: 84px;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--bg);
    transform: translateY(-110%);
    transition: transform 0.35s ease;
    z-index: 40;
  }
  nav.main-nav.open { transform: translateY(0); }
  nav.main-nav ul {
    flex-direction: column;
    padding: 40px;
    gap: 26px;
  }
  nav.main-nav a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 22px; }
  section { padding: 70px 0; }
  .footer-bottom { flex-direction: column; gap: 10px; }
}
