/* ==========================================================================
   DEU POL AGRAR: editorial agricultural business site
   ========================================================================== */

:root {
  --paper: #f2efe8;
  --paper-deep: #e8e3d6;
  --ink: #1e211c;
  --ink-soft: #5d6158;
  --green: #2f4a2b;
  --green-dark: #1f2a1d;
  --ochre: #c9a24a;
  --line: rgba(30, 33, 28, 0.2);

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --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);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1240px;
  --radius: 2px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

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

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

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-block;
  background: var(--green);
  color: var(--paper);
  font: 500 1rem/1 var(--font-body);
  text-decoration: none;
  padding: 1.05rem 1.9rem;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: transparent; color: var(--green); }
.btn-small { padding: 0.65rem 1.1rem; font-size: 0.95rem; }

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.site-header.scrolled {
  background: rgba(242, 239, 232, 0.96);
  border-bottom-color: var(--line);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.25s ease;
}
.site-header.scrolled .header-inner { height: 58px; }

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.logo-mark {
  width: 22px;
  height: 22px;
  background:
    linear-gradient(var(--ochre) 0 0) left / 50% 100% no-repeat,
    linear-gradient(var(--green) 0 0) right / 50% 100% no-repeat;
  transform: rotate(45deg) scale(0.8);
}
.logo-text {
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

.nav { display: flex; align-items: center; gap: 2rem; }
.nav ul { display: flex; gap: 1.75rem; }
.nav ul a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.3rem 0;
  background: linear-gradient(var(--green), var(--green)) 0 100% / 0% 1px no-repeat;
  transition: background-size 0.25s ease;
}
.nav ul a:hover { background-size: 100% 1px; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--space-5)) var(--gutter) var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-4);
  align-items: center;
}
.hero-tag {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--green);
  border-left: 3px solid var(--ochre);
  padding-left: 0.8rem;
  margin-bottom: var(--space-3);
}
.hero h1 {
  font-size: clamp(3rem, 7.4vw, 6.6rem);
  line-height: 0.98;
  max-width: 11ch;
}
.hero-lead {
  max-width: 46ch;
  margin-top: var(--space-3);
  color: var(--ink-soft);
  font-size: 1.15rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}

.hero-visual { position: relative; padding-bottom: 3rem; }
.field-art {
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 620;
  background: var(--paper);
}
.hero-note {
  position: absolute;
  left: -3.5rem;
  bottom: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 1rem 1.25rem;
  max-width: 17rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.hero-note p + p { margin-top: 0.3rem; }
.note-title { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; margin-bottom: 0.4rem; }

/* ---------- About ---------- */
.about {
  background: var(--paper-deep);
  padding: var(--space-6) var(--gutter);
}
.about-head, .about-body { max-width: var(--max); margin: 0 auto; }
.about-head h2 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  max-width: 16ch;
}
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  align-items: start;
}
.about-copy p + p { margin-top: var(--space-2); }
.about-copy p { max-width: 58ch; }

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

.about-visual { position: relative; margin-top: var(--space-4); }
.furrows {
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(circle at 72% 22%, var(--ochre) 0 9%, transparent 9.5%),
    repeating-linear-gradient(100deg, var(--green) 0 14px, #3a5a35 14px 20px, var(--green-dark) 20px 22px);
}
.about-visual figcaption {
  position: relative;
  margin: -3rem 0 0 -2.5rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 1.25rem 1.4rem;
  max-width: 20rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
}

/* ---------- Services ---------- */
.services {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter);
}
.services-title { font-size: clamp(2.3rem, 5vw, 4.4rem); margin-bottom: var(--space-5); }

.service-group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: var(--space-5);
  padding: var(--space-4) 0 var(--space-5);
  border-top: 1px solid var(--ink);
}
.service-group.reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.service-group.reverse .group-intro { order: 2; }
.service-group.reverse .service-list { order: 1; }

.group-intro { align-self: start; position: sticky; top: calc(var(--header-h) + var(--space-3)); }
.group-intro h3 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); margin-bottom: var(--space-2); }
.group-intro p { color: var(--ink-soft); max-width: 36ch; }

.service {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, padding-left 0.25s ease;
}
.service:first-child { padding-top: 0; }
.service:hover { background: var(--paper-deep); padding-left: var(--space-3); }
.service:first-child:hover { padding-top: var(--space-3); }
.service h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin-bottom: 0.4rem; }
.service p { color: var(--ink-soft); max-width: 52ch; }

.icon {
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Why / approach ---------- */
.why {
  background: var(--green-dark);
  color: var(--paper);
  padding: var(--space-6) var(--gutter);
}
.why-inner { max-width: var(--max); margin: 0 auto; }
.why h2 { font-size: clamp(2.3rem, 5vw, 4.4rem); margin-bottom: var(--space-5); }
.why-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 var(--space-4);
}
.why-list li { border-top: 1px solid rgba(242, 239, 232, 0.35); padding-top: var(--space-3); }
.why-list li:nth-child(2) { margin-top: var(--space-4); }
.why-list li:nth-child(4) { margin-top: var(--space-4); }
.num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 6vw, 5.5rem);
  line-height: 1;
  color: var(--ochre);
  margin-bottom: var(--space-2);
}
.why-list h3 { font-size: 1.65rem; margin-bottom: 0.6rem; }
.why-list p { color: rgba(242, 239, 232, 0.78); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-5);
  align-items: start;
}
.contact h2 { font-size: clamp(2.2rem, 4.4vw, 3.8rem); margin-bottom: var(--space-3); }
.contact-lead { color: var(--ink-soft); max-width: 40ch; margin-bottom: var(--space-4); }
address { font-style: normal; border-top: 1px solid var(--ink); padding-top: var(--space-3); }
.addr-label { font-size: 0.9rem; color: var(--ink-soft); margin-top: var(--space-2); }
address p:not(.addr-label) { font-weight: 500; }
address a { text-decoration: none; border-bottom: 1px solid var(--green); color: var(--green); }
address a:hover { background: var(--green); color: var(--paper); }

.contact-form {
  background: #faf8f3;
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.field { margin-bottom: var(--space-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-3); }
label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.35rem; }
.optional { color: var(--ink-soft); font-weight: 400; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
textarea { resize: vertical; min-height: 8rem; }
input:focus, textarea:focus { outline: none; border-color: var(--green); background: #fff; box-shadow: inset 0 -2px 0 var(--green); }
.field.invalid input, .field.invalid textarea { border-color: #9a2f26; }
.error { color: #9a2f26; font-size: 0.88rem; min-height: 1.2rem; margin-top: 0.25rem; }
.form-status { margin-top: var(--space-2); font-weight: 500; }
.form-status:empty { display: none; }
.form-status.success { color: var(--green); border-left: 3px solid var(--green); padding-left: 0.8rem; }
.form-status.fail { color: #9a2f26; border-left: 3px solid #9a2f26; padding-left: 0.8rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(242, 239, 232, 0.8);
  padding: var(--space-5) var(--gutter) var(--space-3);
  font-size: 0.95rem;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}
.footer-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.15; color: var(--paper); margin-bottom: 0.8rem; }
.footer-about p:last-child { max-width: 42ch; }
.footer-head { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--paper); margin-bottom: 0.8rem; letter-spacing: 0; }
.footer-grid li + li { margin-top: 0.35rem; }
.footer-grid p + p { margin-top: 0.6rem; }
.site-footer a { text-decoration: none; transition: color 0.2s ease; }
.site-footer a:hover, .link-button:hover { color: var(--ochre); }
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(242, 239, 232, 0.2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  font-size: 0.88rem;
}
.footer-bottom ul { display: flex; gap: var(--space-3); }
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}
.site-footer :focus-visible { outline-color: var(--ochre); }

/* ---------- Legal dialogs ---------- */
.legal {
  max-width: 34rem;
  width: calc(100% - 2.5rem);
  padding: var(--space-4);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.legal::backdrop { background: rgba(30, 33, 28, 0.55); }
.legal h2 { font-size: 2rem; margin-bottom: var(--space-2); }
.legal p { margin-bottom: var(--space-2); color: var(--ink-soft); }
.legal a { color: var(--green); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + var(--space-4)); }
  .hero h1 { max-width: 13ch; }
  .hero-visual { max-width: 30rem; margin-left: auto; }
  .hero-note { left: -1rem; }
  .about-body { grid-template-columns: 1fr; gap: var(--space-4); }
  .about-visual { max-width: 28rem; }
  .service-group, .service-group.reverse { grid-template-columns: 1fr; gap: var(--space-3); }
  .service-group.reverse .group-intro, .service-group.reverse .service-list { order: 0; }
  .group-intro { position: static; }
  .why-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .why-list li:nth-child(2), .why-list li:nth-child(4) { margin-top: 0; }
  .why-list li:nth-child(even) { margin-top: var(--space-3); }
  .contact { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    padding: var(--space-3) var(--gutter) var(--space-4);
    transform: translateY(-1rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .site-header.scrolled .nav { top: 58px; }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav ul a { display: block; padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); background: none; }
  .nav .btn { text-align: center; padding: 1rem; }
  .hero-note { position: static; margin-top: calc(var(--space-2) * -1); margin-left: var(--space-2); }
  .hero-visual { padding-bottom: 0; }
  .facts div { grid-template-columns: 5.5rem 1fr; }
  .about-visual figcaption { margin: -2rem 0 0 var(--space-2); max-width: 17rem; font-size: 1.25rem; }
  .why-list { grid-template-columns: 1fr; }
  .why-list li:nth-child(even) { margin-top: 0; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
