/* ============================================================
   Kangmeiling — Solarni paneli i eko-sustavi
   Design tokens, base, typography, layout, components
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root {
  /* color */
  --paper:    #f4f1ea;
  --paper-2:  #ebe7da;
  --paper-3:  #e1dccb;
  --ink:      #0a0907;
  --ink-2:    #4a4842;
  --ink-3:    #777269;
  --rule:     #d8d3c2;
  --rule-2:   #c4bea9;
  --accent:   #ff4a18;
  --accent-2: #ffe9dd;
  --accent-ink: #ff4a18;
  --ok:       #2e7a4a;

  /* type */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-sans:    "Geist", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --max:    1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --rule-w: 1px;

  /* radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }

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

/* ===== Language switching ===== */
[data-lang="en"] { display: none; }
html[lang="en"] [data-lang="hr"] { display: none; }
html[lang="en"] [data-lang="en"] { display: inline; }
html[lang="en"] [data-lang="en"].block { display: block; }
[data-lang="hr"].block { display: block; }

/* ===== Layout ===== */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.rule {
  border: 0;
  border-top: var(--rule-w) solid var(--rule);
  margin: 0;
}
.rule-thick {
  border: 0;
  border-top: 1.5px solid var(--ink);
  margin: 0;
}

/* ===== Typography ===== */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.d-xl { font-size: clamp(56px, 11vw, 168px); }
.d-l  { font-size: clamp(44px, 7vw,  104px); }
.d-m  { font-size: clamp(34px, 5vw,  72px); }
.d-s  { font-size: clamp(28px, 3.4vw, 48px); }

.sans-display {
  font-family: var(--f-sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.015em; }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.05; }
h3 { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; }
h4 { font-size: 18px; line-height: 1.25; }

p { margin: 0 0 1em; }
.lede { font-size: clamp(18px, 1.4vw, 22px); line-height: 1.45; color: var(--ink); max-width: 60ch; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.45; }

.mono, .eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 2px;
}
.tabular { font-variant-numeric: tabular-nums; }

/* ===== Top nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border-bottom: var(--rule-w) solid var(--rule);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.brand-mark {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.brand-mark::after {
  background: var(--accent);
  transform: scale(.45);
}
.brand .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 2px; }

.nav-links {
  display: flex; gap: 28px; align-items: center;
  font-size: 14px;
  color: var(--ink);
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
  transition: opacity .2s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px;
  height: 1px; background: var(--accent);
  transition: right .25s var(--ease);
}
.nav-links a:hover::after { right: 0; }
.nav-links a.current::after { right: 0; background: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.lang-switch button {
  padding: 5px 10px;
  color: var(--ink);
}
.lang-switch button.active {
  background: var(--ink);
  color: var(--paper);
}

.nav-burger { display: none; width: 36px; height: 36px; place-items: center; border: 1px solid var(--ink); border-radius: 999px; }
.nav-burger span {
  display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative;
}
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink);
}
.nav-burger span::before { top: -5px; }
.nav-burger span::after  { top: 5px; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-grid; }
  .nav-mobile-open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0; top: 64px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 16px var(--gutter) 24px;
    gap: 12px;
    align-items: flex-start;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .arr { font-size: 14px; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #e23c0d; }

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

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

.btn-ghost { color: var(--ink); padding: 14px 0; }
.btn-ghost::after {
  content: "→"; margin-left: 8px; display: inline-block; transition: transform .25s var(--ease);
}
.btn-ghost:hover::after { transform: translateX(4px); }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ===== Sections & utilities ===== */
.section { padding: clamp(72px, 9vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(40px, 5vw, 72px) 0; }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark .muted { color: #a09c93; }
.section--dark .mono, .section--dark .eyebrow { color: #a09c93; }
.section--dark hr.rule { border-top-color: #2a2620; }
.section--paper-2 { background: var(--paper-2); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 28px;
}
.kicker .num { color: var(--ink); }

.grid { display: grid; gap: 24px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-12 { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 900px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .g-12 { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 600px) {
  .g-12 { grid-template-columns: repeat(2, 1fr); }
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }

.stack-sm > * + * { margin-top: 12px; }
.stack-md > * + * { margin-top: 24px; }
.stack-lg > * + * { margin-top: 40px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: clamp(40px, 6vw, 80px) 0 0;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(56px, 11.5vw, 196px);
  line-height: 0.88;
  letter-spacing: -0.025em;
}
.hero-title em {
  font-style: italic;
  color: var(--ink-2);
}
.hero-title .accent { color: var(--accent); font-style: italic; }
.hero-meta {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  margin-top: 48px;
}
.hero-meta-item { grid-column: span 3; }
.hero-meta-item .mono { display: block; margin-bottom: 8px; }
.hero-meta-item .val { font-size: 28px; font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1; }
.hero-meta-item .sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
@media (max-width: 900px) {
  .hero-meta-item { grid-column: span 6; }
}

/* placeholder image block */
.ph {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  position: relative;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow: hidden;
  border-radius: 2px;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(0,0,0,0.04) 14px 15px);
  pointer-events: none;
}
.ph .ph-label {
  position: relative;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.ph.ink { background: var(--ink); color: #b4ada0; border-color: #1f1c17; }
.ph.ink::before { background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,0.04) 14px 15px); }
.ph.ink .ph-label { background: #14110d; border-color: #2a2620; color: #b4ada0; }

.ph-tall { aspect-ratio: 3 / 4; }
.ph-wide { aspect-ratio: 16 / 9; }
.ph-square { aspect-ratio: 1 / 1; }
.ph-hero { aspect-ratio: 5 / 3; }

/* ===== Card patterns ===== */
.card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 24px;
  border-radius: var(--r-md);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--ink); }

.tile {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: start;
  transition: padding-left .25s var(--ease);
  cursor: pointer;
}
.tile:hover { padding-left: 12px; }
.tile .idx { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; padding-top: 6px; }
.tile .arr { font-family: var(--f-display); font-size: 32px; color: var(--ink); align-self: center; opacity: .4; transition: opacity .2s var(--ease), transform .2s var(--ease);}
.tile:hover .arr { opacity: 1; transform: translateX(6px); }
@media (max-width: 700px) {
  .tile { grid-template-columns: 50px 1fr auto; gap: 16px; padding: 24px 0; }
}

/* feature row */
.feature-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.feature-row > div {
  padding: 32px 24px;
  border-right: 1px solid var(--rule);
}
.feature-row > div:last-child { border-right: 0; }
.feature-row .num {
  font-family: var(--f-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.feature-row .num .unit { font-size: 18px; color: var(--ink-2); margin-left: 2px; vertical-align: top; }
.feature-row .label { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
@media (max-width: 900px) {
  .feature-row { grid-template-columns: repeat(2, 1fr); }
  .feature-row > div:nth-child(2n) { border-right: 0; }
  .feature-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}

/* ===== Footer ===== */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 0;
}
.footer .shell { max-width: var(--max); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  border-bottom: 1px solid #2a2620;
  padding-bottom: 56px;
}
.footer .brand { color: var(--paper); }
.footer .brand-mark::before { background: var(--paper); }
.footer .brand-mark::after { background: var(--accent); }
.footer h5 { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #a09c93; margin: 0 0 18px; font-weight: 500; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; color: #6f6a60;
  text-transform: uppercase;
  flex-wrap: wrap; gap: 16px;
}
.footer-mega {
  font-family: var(--f-display);
  font-size: clamp(72px, 14vw, 220px);
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 64px 0 32px;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
}
.footer-mega .accent { color: var(--accent); font-style: italic; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ===== Forms ===== */
.field {
  display: block;
  position: relative;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
}
.field label {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 18px;
  padding: 4px 0;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field:focus-within { border-color: var(--ink); }

/* Toggle group */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  background: var(--paper);
}
.toggle-group button {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease);
  color: var(--ink);
}
.toggle-group button.active {
  background: var(--ink);
  color: var(--paper);
}

/* Pill / chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-size: 12px;
  background: var(--paper);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}
.chip.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.accent { background: var(--accent-2); color: var(--accent); border-color: var(--accent-2); }
.chip.ok { background: #e0f0e6; color: var(--ok); border-color: #b8d8c2; }

/* Marquee / ticker */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  overflow: hidden;
  padding: 18px 0;
}
.ticker-track {
  display: flex; gap: 56px;
  animation: ticker 40s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.ticker span {
  font-family: var(--f-display);
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ticker span .accent { color: var(--accent); font-style: italic; }
.ticker .star { color: var(--accent); font-size: 22px; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }

/* Section heading pattern */
.s-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}
.s-head .lhs { display: grid; gap: 16px; }
.s-head .rhs { color: var(--ink-2); max-width: 50ch; font-size: 17px; line-height: 1.5; padding-bottom: 6px; }
@media (max-width: 820px) {
  .s-head { grid-template-columns: 1fr; gap: 24px; }
}

/* Big pill stat */
.pill-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 24px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.pill-stat .num { font-size: 28px; }
.pill-stat .accent { color: var(--accent); }

/* Process steps */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
.process > div {
  padding: 32px 24px 40px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.process > div:last-child { border-right: 0; }
.process .step-num { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 24px; }
.process h4 { margin-bottom: 12px; }
.process p { font-size: 14px; color: var(--ink-2); margin: 0; }
@media (max-width: 900px) {
  .process { grid-template-columns: repeat(2, 1fr); }
  .process > div:nth-child(2n) { border-right: 0; }
}
@media (max-width: 540px) {
  .process { grid-template-columns: 1fr; }
  .process > div { border-right: 0; }
}

/* Article cards (blog) */
.article-card {
  display: grid;
  gap: 16px;
  cursor: pointer;
}
.article-card .ph { aspect-ratio: 4 / 3; }
.article-card .meta { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-2); text-transform: uppercase; }
.article-card h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: -.02em; font-size: 28px; line-height: 1.1; }
.article-card:hover h3 { color: var(--accent); }

/* Tags row */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sun visual (svg slot) */
.sun {
  width: 100%; aspect-ratio: 1; display: grid; place-items: center;
}
