/* ==========================================================================
   AFS ENERGIA SP Z O O — style.css
   Editorial, contemporary European creative-business look.
   Structure:
     1. Design tokens        7. About
     2. Reset & base         8. Services
     3. Layout helpers       9. Approach (dark section)
     4. Header & navigation 10. Contact & form
     5. Buttons & links     11. Footer
     6. Hero                12. Dialogs, reveal, responsive, motion
   ========================================================================== */


/* 1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Colour — warm paper, charcoal ink, one terracotta accent */
  --paper: #f4efe7;
  --paper-2: #ece5d8;
  --sand: #ddd3c0;
  --ink: #1c1b19;
  --muted: #6a655d;
  --accent: #b5452a;
  --accent-deep: #8a3320;
  --accent-on-dark: #e57f60;

  --line: rgba(28, 27, 25, 0.16);
  --line-light: rgba(244, 239, 231, 0.2);
  --on-dark-muted: rgba(244, 239, 231, 0.72);

  /* Typography */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container: 1320px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --col-gap: clamp(1rem, 2.5vw, 2.5rem);
  --section-space: clamp(5rem, 11vw, 9.5rem);
  --header-h: 76px;
  --header-h-compact: 58px;

  /* Misc */
  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.35s;

  /* Arrow glyph, used as a CSS mask so it inherits currentColor */
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}


/* 2. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-compact) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

html.menu-lock,
html.dialog-lock {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  body {
    overflow-x: clip;
  }
}

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

h1, h2, h3, p, ul, ol, dl, dd, figure, address, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

[tabindex="-1"]:focus {
  outline: none;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 300;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0.75rem;
}


/* 3. LAYOUT HELPERS & TYPE PRIMITIVES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-no {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--accent);
}

.eyebrow-no::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}

.eyebrow--line::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2.2rem, 4.8vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title em,
.hero-title em {
  font-style: italic;
  font-weight: 340;
  color: var(--accent);
}

.section-intro {
  max-width: 34rem;
  font-size: 1.05rem;
  color: var(--muted);
}

/* Illustrations — palette classes so every SVG follows the design tokens */
.s-ink { fill: var(--ink); }
.s-paper { fill: var(--paper); }
.s-paper-2 { fill: var(--paper-2); }
.s-sand { fill: var(--sand); }
.s-acc { fill: var(--accent); }
.s-acc-deep { fill: var(--accent-deep); }
.st-ink { fill: none; stroke: var(--ink); }
.st-paper { fill: none; stroke: var(--paper); }

.svg-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  fill: var(--paper);
}

.media {
  position: relative;
  overflow: hidden;
  background: var(--sand);
}

.media svg {
  width: 100%;
  height: 100%;
  transition: transform 0.9s var(--ease);
}

.fig-caption {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}


/* 4. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: height var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: var(--paper);
  border-bottom-color: var(--line);
}

.site-header.is-scrolled {
  height: var(--header-h-compact);
}

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

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  transition: transform var(--dur) var(--ease);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  background: var(--ink);
  border-radius: 100% 0 0 0;
}

.brand:hover .brand-mark {
  transform: rotate(90deg);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-text span {
  font-style: italic;
  font-weight: 340;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.4vw, 2.4rem);
}

.nav-list a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.nav-list a:hover::after,
.nav-list a[aria-current]::after {
  transform: scaleX(1);
}

.nav-footnote {
  display: none;
}

.nav-toggle {
  position: relative;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .bar:first-child {
  transform: translateY(4.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}


/* 5. BUTTONS & LINKS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.btn::after {
  content: "";
  flex: none;
  width: 1.05em;
  height: 1.05em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform var(--dur) var(--ease);
}

.btn:hover::after {
  transform: translateX(4px);
}

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

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

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

.btn-small {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.link-arrow::after {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform var(--dur) var(--ease);
}

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

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


/* 6. HERO
   ========================================================================== */
.hero {
  padding-top: calc(var(--header-h) + clamp(2rem, 6vw, 5rem));
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: center;
}

.hero-copy {
  grid-column: 1 / span 7;
}

.hero-title {
  margin: 1.5rem 0 1.75rem;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2.75rem, 6.3vw, 5.9rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.hero-lead {
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted);
}

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

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 1rem clamp(1.5rem, 3vw, 3rem);
  max-width: 34rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
}

.hero-meta dt {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta dd {
  margin-top: 0.2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-meta a {
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

.hero-visual {
  position: relative;
  grid-column: 8 / -1;
}

.hero-main {
  aspect-ratio: 4 / 5;
}

.hero-inset {
  position: absolute;
  left: -12%;
  bottom: 5.5%;
  width: 46%;
  aspect-ratio: 1;
  border: 8px solid var(--paper);
}

.hero-stat {
  position: absolute;
  top: 14%;
  right: -1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  background: var(--ink);
  color: var(--paper);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 340;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.hero-side {
  display: none;
  position: absolute;
  top: 0;
  right: -2.25rem;
  writing-mode: vertical-rl;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-visual .fig-caption {
  max-width: 60%;
  margin: 0.85rem 0 0 auto;
  text-align: right;
}

.hero-visual:hover .hero-main svg {
  transform: scale(1.03);
}

/* Areas strip */
.areas {
  border-block: 1px solid var(--ink);
}

.areas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  padding-block: 1.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.areas-list li:not(:last-child)::after {
  content: "/";
  margin-inline: 1.1rem;
  color: var(--accent);
}


/* 7. ABOUT
   ========================================================================== */
.about-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.about-head .eyebrow {
  grid-column: 1 / span 3;
  align-self: start;
  padding-top: 1rem;
}

.about-head .section-title {
  grid-column: 4 / -1;
  max-width: 17ch;
}

.about-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 3rem;
  align-items: start;
}

.about-visual {
  position: relative;
  grid-column: 1 / span 6;
  margin-bottom: 3.5rem;
}

.about-main {
  aspect-ratio: 4 / 3;
}

.about-inset {
  position: absolute;
  right: -12%;
  bottom: 1.5rem;
  width: 36%;
  aspect-ratio: 3 / 4;
  transform: translateY(35%);
  border: 8px solid var(--paper);
}

.about-visual .fig-caption {
  max-width: 55%;
  margin-top: 0.85rem;
}

.about-text {
  grid-column: 8 / -1;
}

.about-text > p:first-child {
  font-size: 1.25rem;
  line-height: 1.55;
}

.about-text > p + p {
  margin-top: 1.25rem;
  color: var(--muted);
}

.statement {
  margin-top: 2.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
}

.statement p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-style: italic;
  font-weight: 350;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.statement footer {
  margin-top: 0.85rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--ink);
}

.fact {
  padding: 1.5rem 1.5rem 0 0;
}

.fact + .fact {
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.fact dt {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 340;
  line-height: 1;
  letter-spacing: -0.02em;
}

.fact dd {
  max-width: 17rem;
  margin-top: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}


/* 8. SERVICES
   ========================================================================== */
.services {
  background: var(--paper-2);
}

.services-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 1.5rem;
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.services-head .eyebrow {
  grid-column: 1 / -1;
}

.services-head .section-title {
  grid-column: 1 / span 7;
}

.services-head .section-intro {
  grid-column: 9 / -1;
}

.services-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 3rem;
  align-items: start;
}

.service-num {
  font-size: 0.8rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}

.icon {
  flex: none;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* Featured service */
.service-featured {
  grid-column: 1 / span 6;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.service-media {
  aspect-ratio: 8 / 5;
}

.service-featured:hover .service-media svg {
  transform: scale(1.035);
}

.service-featured-body {
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.service-featured-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.service-featured:hover .service-num {
  color: var(--accent);
}

.service-featured:hover .icon {
  color: var(--accent);
}

.service-featured h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.service-featured-body > p {
  margin-top: 0.85rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tags li {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Numbered rows */
.service-list {
  grid-column: 7 / -1;
  border-bottom: 1px solid var(--ink);
}

.service-row {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 2.5rem 2rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding: 1.6rem 0.9rem 1.7rem;
  border-top: 1px solid var(--ink);
}

.service-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.service-row:hover::before,
.service-row:focus-within::before {
  opacity: 1;
}

.service-row:hover .service-num,
.service-row:hover .icon,
.service-row:focus-within .service-num,
.service-row:focus-within .icon {
  color: var(--accent);
}

.service-row:hover .icon {
  transform: translateY(-2px);
}

.service-row .service-num {
  padding-top: 0.55rem;
}

.service-row .icon {
  margin-top: 0.15rem;
}

.service-row h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.service-row-body p {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--muted);
}

.service-row .link-arrow {
  font-size: 0.85rem;
}


/* 9. APPROACH (DARK SECTION)
   ========================================================================== */
.benefits {
  background: var(--ink);
  color: var(--paper);
}

.benefits .eyebrow {
  color: var(--on-dark-muted);
}

.benefits .eyebrow-no,
.benefits .section-title em {
  color: var(--accent-on-dark);
}

.benefits .section-intro {
  color: var(--on-dark-muted);
}

.benefits :focus-visible {
  outline-color: var(--accent-on-dark);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}

.benefits-head {
  position: sticky;
  top: calc(var(--header-h-compact) + 2rem);
  grid-column: 1 / span 4;
  display: grid;
  gap: 1.5rem;
}

.benefit-list {
  grid-column: 6 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3.5vw, 3.5rem);
}

.benefit {
  position: relative;
  padding: 1.5rem 0 3.5rem;
  border-top: 1px solid var(--line-light);
}

.benefit::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--accent-on-dark);
}

.benefit:nth-child(even) {
  margin-top: 4.5rem;
}

.benefit-num {
  display: block;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  font-style: italic;
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--accent-on-dark);
}

.benefit h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.15;
}

.benefit p {
  margin-top: 0.75rem;
  max-width: 24rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}


/* 10. CONTACT & FORM
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 3.5rem;
  align-items: start;
}

.contact-info {
  grid-column: 1 / span 5;
  display: grid;
  justify-items: start;
  gap: 1.5rem;
}

.contact-details {
  width: 100%;
  margin-top: 1rem;
  font-style: normal;
  border-bottom: 1px solid var(--line);
}

.detail {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.detail-label {
  padding-top: 0.2rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-value {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
}

.detail-email {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--line);
  overflow-wrap: anywhere;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.detail-email:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.contact-form {
  grid-column: 7 / -1;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.req {
  color: var(--accent);
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(28, 27, 25, 0.35);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink);
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--accent-deep);
  background: #f8ece6;
}

.field-error {
  min-height: 1.3rem;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--accent-deep);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 0.75rem;
}

.form-note {
  flex: 1 1 14rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.form-note a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.form-status {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--ink);
  background: var(--paper);
  font-size: 0.95rem;
  line-height: 1.55;
}

.form-status[data-state="error"] {
  border-left-color: var(--accent-deep);
  background: #f8ece6;
}

.form-status strong {
  display: block;
  margin-bottom: 0.15rem;
}

.form-status a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}


/* 11. FOOTER
   ========================================================================== */
.site-footer {
  padding-top: clamp(4rem, 8vw, 6.5rem);
  background: var(--ink);
  color: var(--paper);
}

.site-footer :focus-visible {
  outline-color: var(--accent-on-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 3rem;
}

.footer-brand {
  grid-column: 1 / span 5;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.02em;
}

.footer-wordmark em {
  font-weight: 320;
  color: var(--accent-on-dark);
}

.footer-legal-name {
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.footer-about {
  max-width: 24rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.footer-nav {
  grid-column: 7 / span 2;
}

.footer-contact {
  grid-column: 9 / -1;
}

.footer-heading {
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.footer-nav li + li {
  margin-top: 0.5rem;
}

.footer-nav a,
.footer-contact a,
.footer-legal a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size var(--dur) var(--ease), color var(--dur) var(--ease);
}

.footer-nav a:hover,
.footer-contact a:hover,
.footer-legal a:hover {
  background-size: 100% 1px;
}

.footer-contact address {
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--on-dark-muted);
}

.footer-contact a {
  color: var(--paper);
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-block: 1.5rem;
  border-top: 1px solid var(--line-light);
  font-size: 0.85rem;
  color: var(--on-dark-muted);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}


/* 12. DIALOGS, REVEAL, RESPONSIVE, MOTION
   ========================================================================== */

/* Legal dialogs */
.legal-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: min(85vh, 48rem);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.legal-dialog[open] {
  display: flex;
}

.legal-dialog::backdrop {
  background: rgba(28, 27, 25, 0.62);
}

.dialog-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.1;
}

.dialog-close {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dialog-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.dialog-body {
  overflow-y: auto;
  padding: 1.25rem clamp(1.25rem, 3vw, 2rem) 2rem;
  font-size: 0.97rem;
  line-height: 1.65;
}

.dialog-body h3 {
  margin: 1.5rem 0 0.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
}

.dialog-body h3:first-child {
  margin-top: 0;
}

.dialog-body p {
  color: var(--muted);
}

.dialog-body a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

/* Reveal on scroll — only hides content when JavaScript is running */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Wide desktop refinements ---------- */
@media (min-width: 1100px) {
  .hero-side {
    display: block;
  }
}

/* ---------- Tablet landscape ---------- */
@media (max-width: 1099.98px) {
  .hero-copy {
    grid-column: 1 / span 7;
  }

  .hero-visual {
    grid-column: 8 / -1;
  }

  .hero-meta {
    grid-template-columns: repeat(2, auto);
  }

  .hero-meta > div:last-child {
    grid-column: 1 / -1;
  }

  .about-text {
    grid-column: 7 / -1;
  }

  .service-featured {
    grid-column: 1 / span 6;
  }

  .service-list {
    grid-column: 7 / -1;
  }

  .service-row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    padding-inline: 0.6rem;
  }

  .service-row .icon {
    display: none;
  }
}

/* ---------- Tablet portrait & mobile: stacked layouts + overlay navigation ---------- */
@media (max-width: 899.98px) {

  /* Navigation becomes a full-screen overlay */
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2rem;
    padding: calc(var(--header-h) + 1.25rem) var(--gutter) 2rem;
    background: var(--paper);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }

  .primary-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    counter-reset: nav;
  }

  .nav-list a {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 7vw, 2.6rem);
    font-weight: 380;
    line-height: 1.1;
  }

  .nav-list a::before {
    counter-increment: nav;
    content: "0" counter(nav);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--accent);
  }

  .nav-list a::after {
    display: none;
  }

  .nav-list a[aria-current] {
    color: var(--accent);
  }

  .primary-nav .btn {
    align-self: flex-start;
    padding: 0.9rem 1.4rem;
    font-size: 0.95rem;
  }

  .nav-footnote {
    display: block;
    margin-top: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
  }

  /* Hero */
  .hero-grid {
    row-gap: 3.5rem;
  }

  .hero-copy,
  .hero-visual {
    grid-column: 1 / -1;
  }

  .hero-visual {
    width: min(100%, 34rem);
    margin-left: auto;
  }

  .hero-inset {
    left: -6%;
  }

  .hero-title {
    font-size: clamp(2.75rem, 10vw, 5rem);
  }

  .hero-meta {
    grid-template-columns: repeat(3, auto);
  }

  .hero-meta > div:last-child {
    grid-column: auto;
  }

  /* About */
  .about-head .eyebrow,
  .about-head .section-title {
    grid-column: 1 / -1;
  }

  .about-head .eyebrow {
    padding-top: 0;
  }

  .about-visual,
  .about-text {
    grid-column: 1 / -1;
  }

  .about-visual {
    width: min(100%, 36rem);
  }

  .about-inset {
    right: -6%;
  }

  .about-text {
    max-width: 38rem;
  }

  /* Services */
  .services-head .section-title,
  .services-head .section-intro {
    grid-column: 1 / -1;
  }

  .service-featured,
  .service-list {
    grid-column: 1 / -1;
  }

  .service-row {
    grid-template-columns: 2.5rem 2rem minmax(0, 1fr);
    padding-inline: 0.9rem;
  }

  .service-row .icon {
    display: block;
  }

  /* Approach */
  .benefits-head {
    position: static;
    grid-column: 1 / -1;
    margin-bottom: 3rem;
  }

  .benefit-list {
    grid-column: 1 / -1;
  }

  .benefit:nth-child(even) {
    margin-top: 2.5rem;
  }

  /* Contact */
  .contact-info,
  .contact-form {
    grid-column: 1 / -1;
  }

  .contact-info {
    max-width: 38rem;
  }

  /* Footer */
  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-nav {
    grid-column: 1 / span 5;
  }

  .footer-contact {
    grid-column: 6 / -1;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 599.98px) {
  :root {
    --header-h: 64px;
  }

  body {
    font-size: 1rem;
  }

  .hero-visual {
    width: 100%;
  }

  .hero-inset {
    left: -4%;
    bottom: 4%;
    width: 44%;
    border-width: 6px;
  }

  .hero-stat {
    right: -0.5rem;
    padding: 0.7rem 0.9rem;
  }

  .stat-num {
    font-size: 2rem;
  }

  .hero-meta {
    grid-template-columns: 1fr 1fr;
  }

  .hero-meta > div:last-child {
    grid-column: 1 / -1;
  }

  .hero-actions {
    gap: 1.25rem;
  }

  .areas-list {
    font-size: 0.72rem;
  }

  .areas-list li:not(:last-child)::after {
    margin-inline: 0.7rem;
  }

  .about-inset {
    right: -3%;
    border-width: 6px;
  }

  .about-visual .fig-caption {
    max-width: 60%;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .fact,
  .fact + .fact {
    padding: 1.25rem 0;
    border-left: 0;
  }

  .fact + .fact {
    border-top: 1px solid var(--line);
  }

  .service-row {
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: 0.9rem;
    padding-inline: 0.5rem;
  }

  .service-row .icon {
    display: none;
  }

  .benefit-list {
    grid-template-columns: 1fr;
  }

  .benefit:nth-child(even) {
    margin-top: 0;
  }

  .benefit {
    padding-bottom: 2.5rem;
  }

  .detail {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form-foot .btn {
    width: 100%;
    justify-content: space-between;
  }

  .footer-nav,
  .footer-contact {
    grid-column: 1 / -1;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
