/* ==========================================================
   F SECURITY: stylesheet
   Structure: tokens, base, layout, components, sections, responsive
   ========================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* colour: neutrals plus one accent */
  --paper: #eeece5;
  --paper-2: #e3e0d6;
  --ink: #1a1c19;
  --muted: #5b5f58;
  --green: #24533f;
  --green-deep: #12241c;
  --line: rgba(26, 28, 25, 0.2);

  /* colour on dark */
  --on-dark: #ebe9e1;
  --on-dark-muted: #a8b4ab;
  --line-dark: rgba(235, 233, 225, 0.22);

  /* type */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4.5rem, 9vw, 8rem);

  /* layout */
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 76px;
  --radius: 2px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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;
}

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

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

address { font-style: normal; }

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

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-6);
  scroll-margin-top: var(--header-h);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.55;
}

/* ---------- 4. Buttons and links ---------- */
.btn {
  display: inline-block;
  padding: 0.95rem 1.7rem;
  font: 600 0.95rem/1 var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--paper);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }

.btn-small { padding: 0.7rem 1.1rem; font-size: 0.875rem; }

.text-link {
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.3s var(--ease), color 0.2s;
}
.text-link:hover { background-size: 40% 1px; color: var(--green); }

/* ---------- 5. Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(238, 236, 229, 0.96);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: var(--container);
  height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  transition: height 0.3s var(--ease);
}
.site-header.is-scrolled .header-inner { height: 60px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--paper);
  background: var(--green);
}
.logo-text {
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-list { display: flex; gap: var(--space-3); }
.nav-list a {
  position: relative;
  padding-block: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-list a:hover::after { transform: scaleX(1); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), background-color 0.2s;
}
.menu-bars { position: relative; margin: auto; }
.menu-bars::before,
.menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 6. Inline SVG art ---------- */
.s-stone { fill: var(--paper-2); }
.s-paper { fill: var(--paper); }
.s-paper-2 { fill: var(--paper-2); }
.s-ink { fill: var(--ink); }
.s-deep { fill: var(--green-deep); }
.s-green { fill: var(--green); }
.s-line { fill: var(--line); }

figure svg { width: 100%; height: 100%; }

/* ---------- 7. Hero ---------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(2rem, 6vw, 5rem));
  padding-bottom: var(--space-6);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7.4vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-lead {
  max-width: 34rem;
  margin-top: var(--space-4);
  font-size: 1.2rem;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}

.hero-visual {
  position: relative;
  aspect-ratio: 5 / 5.8;
}
.hero-fig { position: absolute; overflow: hidden; }
.hero-fig-main {
  top: 0;
  right: 0;
  width: 68%;
  aspect-ratio: 520 / 640;
}
.hero-fig-second {
  left: 0;
  bottom: 4%;
  width: 46%;
  aspect-ratio: 360 / 260;
  border: 6px solid var(--paper);
}
.hero-plate {
  position: absolute;
  left: 0;
  top: 8%;
  width: 44%;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2);
  background: var(--paper);
  border: 1px solid var(--ink);
}
.plate-title {
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.1;
  border-bottom: 1px solid var(--line);
}
.plate-list div + div { margin-top: 0.6rem; }
.plate-list dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}
.plate-list dd {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- 8. About ---------- */
.about { border-top: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-4);
  row-gap: var(--space-5);
  align-items: start;
}
.about-head { grid-column: 1 / span 8; }
.about-visual {
  grid-column: 1 / span 5;
  grid-row: 2;
}
.about-fig {
  position: relative;
  aspect-ratio: 3 / 2.1;
  overflow: hidden;
}
.about-fig figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  color: var(--on-dark);
  background: rgba(18, 36, 28, 0.82);
}
.about-text {
  grid-column: 7 / span 6;
  grid-row: 2;
  margin-top: var(--space-4);
}
.about-text > p + p { margin-top: var(--space-2); }
.about-text > p:not(.lead) { color: var(--muted); }

.facts {
  margin-top: var(--space-4);
  border-top: 1px solid var(--ink);
}
.facts div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--space-2);
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.facts dt { font-size: 0.9rem; font-weight: 600; }
.facts dd { font-size: 0.95rem; color: var(--muted); }

/* ---------- 9. Services ---------- */
.services {
  background: var(--paper-2);
}
.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.services-head {
  position: sticky;
  top: calc(var(--header-h) + var(--space-3));
}
.services-intro {
  max-width: 24rem;
  margin-top: var(--space-3);
  color: var(--muted);
}
.services-fig {
  width: 62%;
  aspect-ratio: 5 / 6;
  margin-top: var(--space-4);
  overflow: hidden;
}

.service-list { border-top: 1px solid var(--ink); }

.service {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-2) var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.service::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--green);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.service:hover {
  background: rgba(238, 236, 229, 0.7);
  padding-left: var(--space-2);
}
.service:hover::before { transform: scaleY(1); }

.service-icon {
  width: 3rem;
  height: 3rem;
  color: var(--green);
}
.service-icon svg { width: 100%; height: 100%; }

.service-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
}
.service-body p {
  margin-top: 0.4rem;
  max-width: 34rem;
  font-size: 0.98rem;
  color: var(--muted);
}
.service-tag {
  padding-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.service-featured {
  padding-block: var(--space-4);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-top: 0;
  padding-inline: var(--space-3);
}
.service-featured:hover { background: var(--paper); padding-left: var(--space-3); }
.service-featured .service-icon { width: 3.5rem; height: 3.5rem; }
.service-featured h3 { font-size: clamp(2rem, 3.4vw, 2.7rem); }
.service-featured p { font-size: 1.05rem; }
.service-featured .service-tag { color: var(--green); font-weight: 600; }

/* ---------- 10. Why / Approach (dark) ---------- */
.why {
  color: var(--on-dark);
  background: var(--green-deep);
}
.why-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--space-4);
  align-items: end;
}
.why-head p { color: var(--on-dark-muted); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 8vw, 8rem);
  margin-top: var(--space-5);
}
.why-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
  padding-block: var(--space-4);
  border-top: 1px solid var(--line-dark);
}
.why-item:nth-child(even) { transform: translateY(var(--space-5)); }
.why-num {
  grid-row: 1 / span 2;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  line-height: 0.8;
  color: var(--on-dark);
  opacity: 0.9;
}
.why-item h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
}
.why-item p {
  margin-top: 0.5rem;
  font-size: 0.98rem;
  color: var(--on-dark-muted);
}
.why .why-grid { padding-bottom: var(--space-5); }

/* ---------- 11. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: start;
}
.contact-info .lead {
  max-width: 28rem;
  margin-top: var(--space-3);
  color: var(--muted);
}
.contact-details {
  margin-top: var(--space-4);
  border-top: 1px solid var(--ink);
}
.contact-details div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: var(--space-2);
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.contact-details dt { font-size: 0.9rem; font-weight: 600; }
.contact-details dd { font-size: 1.05rem; }

.contact-form {
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background: var(--paper-2);
  border-top: 3px solid var(--green);
}
.field { margin-bottom: var(--space-3); }
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-3);
}
.field label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.optional { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--green);
  box-shadow: 0 1px 0 var(--green);
}
.field.has-error input,
.field.has-error textarea {
  border-bottom-color: #9a2b1f;
  box-shadow: 0 1px 0 #9a2b1f;
}
.field-error {
  min-height: 0;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #9a2b1f;
}
.field-error:empty { display: none; }

.form-actions { margin-top: var(--space-4); }
.form-status {
  margin-top: var(--space-3);
  font-size: 0.95rem;
}
.form-status:empty { display: none; }
.form-status.is-success {
  padding: 0.9rem 1rem;
  color: var(--green-deep);
  background: var(--paper);
  border-left: 3px solid var(--green);
}
.form-status.is-error {
  padding: 0.9rem 1rem;
  color: #6f1d14;
  background: var(--paper);
  border-left: 3px solid #9a2b1f;
}

/* ---------- 12. Footer ---------- */
.site-footer {
  padding-top: var(--space-5);
  color: var(--on-dark);
  background: var(--ink);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}
.logo-light .logo-mark { background: var(--on-dark); color: var(--ink); }
.footer-brand p { max-width: 24rem; margin-top: var(--space-2); font-size: 0.95rem; color: var(--on-dark-muted); }
.footer-brand .footer-company { margin-top: var(--space-3); font-size: 0.85rem; font-weight: 600; color: var(--on-dark); }

.footer-col h2 {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
}
.footer-col li + li { margin-top: 0.4rem; }
.footer-col,
.footer-col a { font-size: 0.95rem; color: var(--on-dark-muted); text-decoration: none; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: 4px; }

.footer-bottom {
  padding-block: var(--space-3);
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  border-top: 1px solid var(--line-dark);
}

/* ---------- 13. Legal dialogs ---------- */
.legal-dialog {
  width: min(92vw, 36rem);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.legal-dialog::backdrop { background: rgba(18, 36, 28, 0.6); }
.dialog-inner { padding: var(--space-4); }
.dialog-inner h2 {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
}
.dialog-inner p { margin-bottom: var(--space-2); font-size: 0.98rem; color: var(--muted); }
.dialog-inner form { margin-top: var(--space-3); }

/* ---------- 14. Reveal on scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js .why-item[data-reveal] { transform: translateY(14px); }
.js .why-item:nth-child(even)[data-reveal] { transform: translateY(calc(var(--space-5) + 14px)); }
.js .why-item:nth-child(even)[data-reveal].is-visible { transform: translateY(var(--space-5)); }
.js .why-item[data-reveal].is-visible { transform: none; }
.js .why-item:nth-child(even)[data-reveal].is-visible { transform: translateY(var(--space-5)); }

/* ---------- 15. Responsive ---------- */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; width: 100%; margin-inline: auto 0; }
  .about-head { grid-column: 1 / -1; }
  .about-visual { grid-column: 1 / -1; grid-row: auto; }
  .about-text { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }
  .services-grid { grid-template-columns: 1fr; }
  .services-head { position: static; }
  .services-fig { display: none; }
  .why-head { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-3) var(--gutter) var(--space-4);
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .site-header.is-scrolled .site-nav { inset-block-start: 60px; }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { display: block; padding-block: 0.9rem; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .nav-list a::after { display: none; }
  .site-nav .btn { text-align: center; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 1rem; }
  .hero-visual { aspect-ratio: auto; max-width: none; }
  .hero-fig { position: relative; }
  .hero-fig-main { width: 82%; margin-left: auto; }
  .hero-fig-second { display: none; }
  .hero-plate {
    position: relative;
    top: auto;
    width: 88%;
    margin-top: -3.5rem;
  }
  .facts div,
  .contact-details div { grid-template-columns: 1fr; gap: 0.15rem; }
  .service { grid-template-columns: 2.6rem minmax(0, 1fr); gap: var(--space-2); }
  .service-icon { width: 2.4rem; height: 2.4rem; }
  .service-tag { display: none; }
  .service-featured { padding-inline: var(--space-2); }
  .service-featured:hover { padding-left: var(--space-2); }
  .why-grid { grid-template-columns: 1fr; padding-bottom: 0; }
  .why-item:nth-child(even),
  .js .why-item:nth-child(even)[data-reveal],
  .js .why-item:nth-child(even)[data-reveal].is-visible { transform: none; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 16. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .why-item:nth-child(even)[data-reveal] { transform: translateY(var(--space-5)); }
}
