/* AGRO-POL Polskie Zboża — site styles */

:root {
  --green: #1E6B3B;
  --green-deep: #154F2B;
  --night: #0F2A1A;
  --red: #DC1F1A;
  --red-deep: #B8170F;
  --mist: #EEF1EC;
  --ink: #17201A;
  --muted: #4B574F;
  --straw: #E2B04A;
  --line: rgba(23, 32, 26, .14);
  --line-light: rgba(255, 255, 255, .22);

  --f-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(80px, 11vw, 152px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.75rem); font-weight: 750; line-height: 1.02; letter-spacing: -.025em; }
h3 { font-size: 1.25rem; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--straw); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: #fff; padding: 12px 16px; border-radius: 8px; }
.skip:focus { top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 1.6em; border-radius: 999px; border: 0;
  font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-deep); }
.btn-ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); }
.btn-ghost:hover { background: #fff; color: var(--night); }
.link { font-weight: 600; color: var(--green); text-underline-offset: 4px; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: #fff;
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 84px; transition: height .3s; }
.brand { flex: none; display: block; }
.brand img { height: 50px; width: auto; transition: height .3s; }
.brand-dark { display: none !important; }
.nav { display: flex; gap: 28px; margin-left: auto; font-weight: 500; font-size: .975rem; }
.nav a { text-decoration: none; padding-block: 6px; background: linear-gradient(currentColor 0 0) left bottom / 0 1.5px no-repeat; transition: background-size .25s var(--ease-out); }
.nav a:hover { background-size: 100% 1.5px; }
.header-call { min-height: 44px; background: var(--red); color: #fff; padding-inline: 1.2em; }
.header-call:hover { background: var(--red-deep); }
.nav-toggle { display: none; }

.site-header.is-solid { background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(12px); }
.site-header.is-solid .header-inner { height: 68px; }
.site-header.is-solid .brand img { height: 42px; }
.site-header.is-solid .brand-light { display: none !important; }
.site-header.is-solid .brand-dark { display: block !important; }

/* Hero */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh; display: grid; grid-template-rows: 1fr auto;
  color: #fff; background: var(--night);
}
.hero-media, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media { z-index: -1; }
.hero-media img { object-fit: cover; object-position: 62% 50%; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 42, 26, .88) 0%, rgba(15, 42, 26, .62) 38%, rgba(15, 42, 26, .05) 72%),
    linear-gradient(0deg, rgba(15, 42, 26, .9) 0%, rgba(15, 42, 26, 0) 32%);
}
.hero-content { align-self: center; padding-top: 128px; padding-bottom: 48px; }
.hero-title {
  font-size: clamp(3rem, 8.4vw, 8rem); font-weight: 800; line-height: .93; letter-spacing: -.035em;
  font-variation-settings: "opsz" 96;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; }
.hero-title .line:nth-child(2) { color: var(--straw); }
.hero-lead { max-width: 34rem; margin-top: 28px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: rgba(255, 255, 255, .86); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-facts {
  list-style: none; margin-block: 0; padding: 0 0 36px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.hero-facts li { border-top: 1px solid var(--line-light); padding-top: 18px; display: grid; gap: 2px; align-content: start; }
.hero-facts strong { font-family: var(--f-display); font-weight: 650; font-size: 1.15rem; }
.hero-facts span { color: rgba(255, 255, 255, .7); font-size: .95rem; }

/* Hero entrance: the page's one orchestrated moment */
@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: settle 2.4s var(--ease-out) both; }
  .hero-title .line > span { animation: rise 1s var(--ease-out) both; }
  .hero-title .line:nth-child(2) > span { animation-delay: .14s; }
  .hero-lead, .hero-actions, .hero-facts { animation: fade 1s .7s var(--ease-out) both; }
}
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } }
@keyframes settle { from { transform: scale(1.08); } }

/* Crops */
.crops { background: var(--mist); }
.crops-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.crops-intro p { margin-top: 24px; max-width: 30rem; color: var(--muted); }
.crops-photo { margin: 40px 0 0; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; }
.crops-photo img { width: 100%; height: 100%; object-fit: cover; }

.crops-table { border-top: 2px solid var(--ink); }
.crops-table .row {
  display: grid; grid-template-columns: 1.15fr 1.6fr 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.crops-table .head { padding: 14px 0; font-size: .875rem; font-weight: 600; color: var(--muted); }
.crops-table .crop { font-family: var(--f-display); font-weight: 650; font-size: 1.3rem; letter-spacing: -.01em; line-height: 1.15; }
.crops-table .row:not(.head) span:not(.crop) { color: var(--muted); }
.crops-note { margin-top: 28px; font-weight: 500; }

/* Route */
.route-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.route-head p { color: var(--muted); max-width: 30rem; }
.route-steps {
  --progress: 1;
  position: relative; list-style: none; padding: 0; margin: clamp(56px, 7vw, 88px) 0 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px;
}
.route-steps::before, .route-steps::after {
  content: ""; position: absolute; left: 24px; right: 24px; top: 23px; height: 3px; border-radius: 3px;
}
.route-steps::before { background: var(--line); }
.route-steps::after { background: var(--red); transform-origin: left; transform: scaleX(var(--progress)); }
.route-steps li { position: relative; z-index: 1; }
.step-n {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: #fff; box-shadow: 0 0 0 6px #fff;
  font: 700 1.2rem/1 var(--f-display);
}
.route-steps h3 { margin-top: 24px; }
.route-steps p { margin-top: 10px; color: var(--muted); font-size: 1rem; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .route-steps::after { animation: draw linear both; animation-timeline: view(); animation-range: entry 30% cover 55%; }
  }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Farms */
.farms { display: grid; grid-template-columns: 1fr 1fr; padding: 0; background: var(--night); color: #fff; }
.farms-photo { position: relative; min-height: 420px; }
.farms-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.farms-body { padding: var(--section) var(--gutter); max-width: 680px; }
.farms-lead { margin-top: 24px; color: rgba(255, 255, 255, .78); max-width: 32rem; }
.farms-list { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 32px; margin: 56px 0 0; }
.farms-list div { border-top: 2px solid var(--straw); padding-top: 18px; }
.farms-list dt { font: 650 1.2rem/1.2 var(--f-display); }
.farms-list dd { margin: 10px 0 0; color: rgba(255, 255, 255, .72); font-size: 1rem; }

/* Port */
.port { position: relative; isolation: isolate; color: #fff; display: grid; min-height: min(100svh, 980px); padding-block: var(--section) clamp(56px, 7vw, 96px); background: #10213a; overflow: hidden; }
.port-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 35%; z-index: -1; }
.port::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 18, 32, .6) 0%, rgba(8, 18, 32, 0) 38%, rgba(8, 18, 32, 0) 52%, rgba(8, 18, 32, .92) 88%); }
.port-inner { display: flex; flex-direction: column; }
.port-inner > p { margin-top: 24px; max-width: 36rem; color: rgba(255, 255, 255, .84); font-size: 1.125rem; }
.buyers { list-style: none; padding: 0; margin: auto 0 0; padding-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.buyers li { border-top: 1px solid rgba(255, 255, 255, .35); padding-top: 18px; display: grid; gap: 4px; align-content: start; }
.buyers strong { font: 650 1.25rem/1.2 var(--f-display); }
.buyers span { color: rgba(255, 255, 255, .7); font-size: .975rem; }

/* Owner */
.owner-grid { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(40px, 7vw, 112px); align-items: center; }
.owner-photo { margin: 0; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; }
.owner-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.owner-body blockquote { margin: 0; }
.owner-body blockquote p {
  font: 550 clamp(1.7rem, 3.3vw, 2.9rem)/1.14 var(--f-display); letter-spacing: -.02em; color: var(--green-deep);
  text-indent: -.42em;
}
.owner-body blockquote p::before { content: "„"; }
.owner-body blockquote p::after { content: "”"; }
.owner-sign { margin-top: 28px; color: var(--muted); display: grid; }
.owner-sign strong { color: var(--ink); font-size: 1.1rem; }
.owner-body .btn { margin-top: 32px; }

/* Contact */
.contact { background: var(--mist); padding-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-phone {
  display: block; margin-top: 36px; text-decoration: none; color: var(--green);
  font: 800 clamp(3rem, 7.5vw, 6.25rem)/1 var(--f-display); letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.contact-phone:hover { color: var(--red); }
.contact-mail { display: inline-block; margin-top: 16px; font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 500; text-underline-offset: 5px; word-break: break-all; }
.contact-addr { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.contact-addr h3 { font-size: 1rem; font-family: var(--f-body); font-weight: 600; color: var(--muted); }
.contact-addr p { margin-top: 8px; }
.contact-addr .link { display: inline-block; margin-top: 12px; }

.quote { background: #fff; border-radius: 22px; padding: clamp(24px, 3vw, 40px); display: grid; gap: 16px; box-shadow: 0 30px 60px -30px rgba(15, 42, 26, .25); }
.quote h3 { font-size: 1.6rem; }
.quote-hint { color: var(--muted); font-size: .925rem; margin-top: -8px; }
.quote label { display: grid; gap: 6px; font-size: .925rem; font-weight: 600; }
.quote-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.quote input, .quote select {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 400 1rem var(--f-body); transition: border-color .2s;
}
.quote input:focus, .quote select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 107, 59, .18); }
.quote [aria-invalid="true"] { border-color: var(--red); }
.quote-error { color: var(--red-deep); font-size: .925rem; font-weight: 500; }
.quote .btn { margin-top: 4px; }

.map { position: relative; margin: var(--section) 0 0; height: clamp(360px, 42vw, 520px); overflow: hidden; background: #e4e6e3; }
.map img { width: 100%; height: 100%; object-fit: cover; }
.map-pin {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -34px 0 0 -17px;
  background: var(--red); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .45);
}
.map-pin::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.map-card {
  position: absolute; left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); bottom: 32px;
  display: grid; gap: 4px; max-width: 340px; padding: 22px 24px; border-radius: 18px;
  background: #fff; box-shadow: 0 24px 48px -24px rgba(15, 42, 26, .45);
}
.map-card strong { font: 650 1.15rem/1.2 var(--f-display); }
.map-card span { color: var(--muted); font-size: .95rem; }
.map-card .btn { margin-top: 14px; min-height: 46px; font-size: .95rem; }
.map-credit { position: absolute; right: 8px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, .85); font-size: .75rem; color: var(--muted); }

/* Footer */
.site-footer { background: var(--night); color: rgba(255, 255, 255, .72); padding-block: 64px; font-size: .95rem; }
.footer-inner { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 40px; align-items: end; }
.footer-inner img { width: 96px; height: auto; }
.footer-copy { white-space: nowrap; }

.site-footer a { color: #fff; text-underline-offset: 3px; }

/* Legal pages */
.legal main { padding-top: calc(68px + clamp(48px, 7vw, 96px)); }
.legal .header-call { display: inline-flex; margin-left: auto; white-space: nowrap; }
.back-link + .header-call { margin-left: 0; }
.back-link { margin-left: auto; font-weight: 500; text-underline-offset: 4px; }
.legal-doc { max-width: 46rem; }
.legal-doc h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.legal-date { margin-top: 12px; color: var(--muted); }
.legal-doc h2 { margin-top: 48px; font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.legal-doc p, .legal-doc ul { margin-top: 14px; }
.legal-doc ul { padding-left: 1.2em; }
.legal-doc li + li { margin-top: 8px; }
.legal-doc li::marker { color: var(--green); }
.legal-doc a:not(.btn) { color: var(--green); text-underline-offset: 3px; }
.quote-hint a { color: var(--green); }

/* Floating call button (phones) */
.fab-call { display: none; }

/* Responsive */
@media (max-width: 1080px) {
  .nav { gap: 20px; }
  .farms-list { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .header-inner { gap: 16px; }
  .header-call { display: none; }
  .nav-toggle {
    display: grid; place-items: center; margin-left: auto; width: 48px; height: 48px;
    border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out), opacity .2s; }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -7px; }
  .bars::after { top: 7px; }
  [aria-expanded="true"] .bars { background: transparent; }
  [aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
  [aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: fixed; inset: 0; z-index: -1; margin: 0;
    flex-direction: column; justify-content: center; gap: 4px; padding: 96px var(--gutter) 40px;
    background: var(--night); color: #fff;
    font: 700 2rem/1.2 var(--f-display); letter-spacing: -.02em;
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
  }
  .nav a { padding-block: 10px; }
  .nav.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }
  .site-header.menu-open { color: #fff; background: transparent; box-shadow: none; backdrop-filter: none; }
  .site-header.menu-open .brand-light { display: block !important; }
  .site-header.menu-open .brand-dark { display: none !important; }

  .crops-grid, .route-head, .owner-grid, .contact-grid { grid-template-columns: 1fr; }
  .farms { grid-template-columns: 1fr; }
  .farms-photo { min-height: 0; aspect-ratio: 16 / 10; }
  .farms-list { grid-template-columns: 1fr 1fr; }
  .buyers { grid-template-columns: 1fr 1fr; }
  .owner-photo { aspect-ratio: 16 / 10; }
  .footer-inner { grid-template-columns: 1fr; align-items: start; }

  /* route turns vertical */
  .route-steps { grid-template-columns: 1fr; gap: 36px; padding-left: 72px; }
  .route-steps::before, .route-steps::after { left: 22.5px; right: auto; top: 24px; bottom: 24px; width: 3px; height: auto; }
  .route-steps::after { transform-origin: top; transform: scaleY(var(--progress)); }
  .step-n { position: absolute; left: -72px; top: -4px; }
  .route-steps h3 { margin-top: 0; }
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .route-steps::after { animation-name: draw-y; animation-range: entry 20% cover 70%; }
    }
  }
  .fab-call {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 40;
    width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: #fff;
    box-shadow: 0 12px 28px -8px rgba(180, 36, 32, .6);
  }
  .fab-call svg { width: 26px; height: 26px; fill: currentColor; }
}
@keyframes draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (max-width: 640px) {
  .back-link { display: none; }
  .back-link + .header-call { margin-left: auto; }
  .map { height: auto; overflow: visible; }
  .map img { height: 300px; }
  .map-pin { top: 150px; }
  .map-credit { bottom: auto; top: 8px; }
  .map-card { position: static; max-width: none; margin: 0 var(--gutter); transform: translateY(-24px); }
  .hero-content { padding-top: 112px; }
  .hero-media::after { background: linear-gradient(180deg, rgba(15, 42, 26, .78) 0%, rgba(15, 42, 26, .7) 60%, rgba(15, 42, 26, .92) 100%); }
  .hero-facts { grid-template-columns: 1fr; gap: 0; padding-bottom: 24px; }
  .hero-facts li { padding-block: 14px; }
  .hero-facts li + li { border-top-color: rgba(255, 255, 255, .14); }
  .hero-actions .btn { flex: 1 1 100%; }
  .crops-table .row { grid-template-columns: 1fr; gap: 4px; }
  .crops-table .head { display: none; }
  .crops-table .row:not(.head) span:last-child { font-size: .925rem; }
  .crops-table .row:not(.head) span:last-child::before { content: "Odbiorcy: "; font-weight: 600; color: var(--ink); }
  .farms-list, .buyers, .contact-addr, .quote-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
