/* Prima Guna Tama – Apple-style redesign.
   Principles: restraint, one accent, big type, translucent chrome,
   springy but interruptible motion, honours prefers-reduced-motion. */

:root {
  --blue: #013cb7;
  --orange: #d04c01;
  --navy: #13223f;

  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --nav-h: 52px;
  --wrap: 1080px;
  --radius: 20px;
  --radius-sm: 12px;

  /* Spring with slight overshoot (CSS linear() easing) */
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.011em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Chinese: Latin tracking and line height are too tight for CJK glyphs. */
body:lang(zh-Hans) { letter-spacing: 0; line-height: 1.75; }

a { color: var(--blue); text-decoration: none; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Header: translucent material ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 26px; width: auto; display: block; }

.nav-main ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 4px;
}

.nav-main a,
.lang-switcher a { white-space: nowrap; }

.nav-main a {
  display: block;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-main a:hover { color: var(--text); }
.nav-main a.active { color: var(--text); background: rgba(0, 0, 0, 0.06); }

.lang-switcher a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 980px;
  border: 1px solid var(--hairline);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s var(--ease), transform 0.5s var(--spring);
}
.lang-switcher a:hover { background: rgba(0, 0, 0, 0.05); }
.lang-switcher { display: flex; gap: 6px; }
.lang-switcher a.active { background: rgba(0, 0, 0, 0.06); }
.lang-switcher a:active { transform: scale(0.94); transition-duration: 0.1s; }

/* ---------- Layout ---------- */
.main { flex: 1; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10vw, 120px) 0 clamp(56px, 9vw, 104px);
  background:
    radial-gradient(60% 70% at 85% 10%, rgba(1, 60, 183, 0.12), transparent 70%),
    radial-gradient(50% 60% at 95% 90%, rgba(208, 76, 1, 0.10), transparent 70%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--orange);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7.2vw, 5rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em; /* tighter at display sizes */
  color: var(--navy);
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 34ch;
  font-size: clamp(1.1875rem, 2.4vw, 1.5rem);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.hero-lead p { margin: 0; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--spring), background 0.2s var(--ease), box-shadow 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.95); transition-duration: 0.1s; } /* instant press feedback */

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0a4ad1; box-shadow: 0 8px 24px rgba(1, 60, 183, 0.28); }

.btn-secondary { background: rgba(1, 60, 183, 0.08); color: var(--blue); }
.btn-secondary:hover { background: rgba(1, 60, 183, 0.14); }

/* Logo card: glass */
.hero-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 12%;
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 80px rgba(19, 34, 63, 0.14);
}
.hero-card img { width: 100%; height: auto; display: block; }

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 9vw, 104px) 0;
  background: var(--bg-alt);
}

.section h2,
.page-content h2 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.section p,
.page-content p { color: var(--muted); }

.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { margin: 0; font-size: 1.1875rem; }

/* Grouped list (iOS Settings style) */
.page-content ul {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.page-content li {
  margin: 0;
  padding: 18px 22px 18px 52px;
  position: relative;
  color: var(--muted);
}
.page-content li + li { border-top: 1px solid var(--hairline); }

.page-content li::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 25px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
}
.page-content li:nth-child(odd)::before { background: var(--blue); }

.page-content strong { color: var(--text); font-weight: 600; }

/* ---------- Inner pages ---------- */
.page-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
}
.page-title {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--navy);
}
.page-body { padding-bottom: clamp(56px, 9vw, 104px); max-width: 760px; }
.page-body > .page-content > p:first-child { font-size: 1.1875rem; margin-top: 0; }
.page-content h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-top: 1.4em; }

.back-link { display: inline-block; margin-bottom: 18px; font-size: 1rem; color: var(--blue); }
.back-link:hover { text-decoration: underline; }
.page-summary { margin: 18px 0 0; max-width: 40ch; font-size: 1.1875rem; line-height: 1.4; color: var(--muted); }

/* Service cards */
.page-body.wide { max-width: none; }
.page-body.wide > .page-content { max-width: 640px; }

.service-list {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.service-list li:last-child:nth-child(odd) { grid-column: 1 / -1; } /* no orphan hole */

.service-list a {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 26px 22px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
  color: var(--text);
  transition: transform 0.5s var(--spring), box-shadow 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.service-list a:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 24px 48px rgba(19, 34, 63, 0.12);
}
.service-list a:active { transform: scale(0.98); transition-duration: 0.1s; } /* instant press */

.service-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: var(--blue);
  background: rgba(1, 60, 183, 0.08);
}
.service-list li:nth-child(even) .service-icon { color: var(--orange); background: rgba(208, 76, 1, 0.09); }
.service-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.service-title {
  font-size: 1.3125rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.service-summary {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 0.9688rem;
  line-height: 1.45;
}
.service-more {
  margin-top: auto;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--blue);
}
.service-more span { display: inline-block; transition: transform 0.5s var(--spring); }
.service-list a:hover .service-more span { transform: translateX(5px); }

@media (max-width: 760px) {
  .service-list { grid-template-columns: 1fr; gap: 12px; }
  .service-list a { padding: 22px 22px 18px; }
}

/* Contact rows */
.contact-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.contact-list li + li { border-top: 1px solid var(--hairline); }

.contact-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  color: var(--text);
  transition: background 0.2s var(--ease), transform 0.5s var(--spring);
}
.contact-list a::after {
  content: "›";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  opacity: 0.6;
  transition: transform 0.5s var(--spring);
}
.contact-list a:hover { background: var(--bg-alt); }
.contact-list a:hover::after { transform: translateX(4px); }
.contact-list a:active { background: #ececf0; transition-duration: 0.05s; }

.contact-label { font-weight: 600; min-width: 6.5em; }
.contact-value {
  flex: 1;
  text-align: right;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 36px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-logo {
  height: 28px;
  width: auto;
  padding: 6px 10px;
  box-sizing: content-box;
  border-radius: 10px;
  background: #fff; /* logo's navy "T" needs a light plate on a navy footer */
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255, 255, 255, 0.85); }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.copyright { margin: 0; }
.footer-area { margin: 0; flex-basis: 100%; order: 1; }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.7s var(--ease), transform 1s var(--spring);
}
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-d="1"] { transition-delay: 0.08s; }
.js .reveal[data-d="2"] { transition-delay: 0.16s; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { order: -1; aspect-ratio: auto; padding: 28px; max-width: 320px; border-radius: 28px; }
  .header-inner { padding: 0 12px; gap: 6px; }
  .logo img { height: 20px; }
  .nav-main ul { gap: 0; }
  .nav-main a { padding: 7px 7px; font-size: 0.8125rem; }
  .lang-switcher { gap: 4px; }
  .lang-switcher a { padding: 4px 8px; font-size: 0.75rem; }
  .contact-list a { flex-wrap: wrap; }
  .contact-value { text-align: left; flex-basis: 100%; }
  .contact-list a::after { display: none; }
}

/* ---------- Reduced motion: keep fades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal { transform: none; }
  .btn:hover, .btn:active,
  .service-list a:hover, .service-list a:active { transform: none; }
}

/* ---------- Reduced transparency ---------- */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero-card { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Kalkulator (ported from docs/ideation/mocks/mock.css) ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; padding: 0 0 clamp(40px, 6vw, 64px); }
.calc-form-col, .calc-result-col { min-width: 0; }
.calc-form, .calc-result { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(19, 34, 63, 0.08); }
.calc-result { position: sticky; top: calc(var(--nav-h) + 16px); scroll-margin-top: calc(var(--nav-h) + 16px); }
.calc-form fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.calc-form legend { font-weight: 600; font-size: 0.9375rem; margin: 0 0 6px; padding: 0; }
.field { display: block; margin: 0 0 18px; }
.field > span:first-child { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 0.8125rem; margin-top: 5px; }
.field select, .money input { width: 100%; font: inherit; color: var(--text); padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--bg); }
.field-block { margin: 0; }
.field-block[hidden] { display: none; }
.field-error { margin: -10px 0 16px; font-size: 0.8125rem; font-weight: 600; color: #a63d00; }
.field-error[hidden] { display: none; }
.field select[aria-invalid="true"], .money input[aria-invalid="true"] { border-color: var(--orange); }
.money { display: block; position: relative; }
.money em { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); }
.money input { padding-left: 42px; font-variant-numeric: tabular-nums; }
.seg { display: flex; background: var(--bg-alt); border-radius: 980px; padding: 4px; margin: 0; }
.seg label { flex: 1; position: relative; min-width: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 8px 10px; border-radius: 980px; font-size: 0.9375rem; cursor: pointer; }
.seg input:checked + span { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
.calc-go { width: 100%; font-size: 1.0625rem; padding: 14px; }
.privacy { color: var(--muted); font-size: 0.8125rem; text-align: center; margin: 12px 0 0; }
.calc-result[hidden], .calc-note[hidden], .big[hidden], .wa-box[hidden] { display: none !important; }
.verdict { display: inline-block; margin: 0; padding: 4px 12px; border-radius: 980px; font-size: 0.875rem; font-weight: 600; }
.verdict.ok { background: rgba(1, 60, 183, 0.09); color: var(--blue); }
.verdict.bad { background: rgba(208, 76, 1, 0.12); color: #a63d00; }
.big { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-result h2 { font-size: 1rem; margin: 0 0 8px; }
.steps { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.steps td { padding: 7px 0; border-bottom: 1px solid var(--hairline); overflow-wrap: anywhere; vertical-align: top; }
.steps td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.steps tr.sub td { font-weight: 600; }
.steps tr.total td { font-weight: 700; color: var(--blue); border-bottom: 0; font-size: 1.0625rem; }
.calc-note { background: var(--bg-alt); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.9375rem; margin: 18px 0; }
.wa-box { border: 1px solid rgba(37, 211, 102, 0.4); background: rgba(37, 211, 102, 0.06); border-radius: var(--radius-sm); padding: 16px; margin: 18px 0 14px; }
.wa-box p { margin: 0 0 10px; }
.btn-wa { background: #25d366; color: #0b3d1e; font-weight: 600; }
.btn-wa:hover { background: #1ebe5a; color: #0b3d1e; }
.wa-preview { font-size: 0.8125rem; color: var(--muted); font-style: italic; margin: 10px 0 0 !important; overflow-wrap: anywhere; }
.rules { font-size: 0.8125rem; color: var(--muted); margin: 0; }
.calc-form .btn, .calc-result .btn { display: inline-block; text-align: center; }
button.btn { font: inherit; border: 0; cursor: pointer; }
@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .calc-result { position: static; }
}
@media (max-width: 760px) {
  .calc-form, .calc-result { padding: 20px; }
  .seg span { font-size: 0.875rem; padding: 8px 6px; }
}
@media print {
  .mock-banner, .site-header, .site-footer, .calc-form-col, .wa-box, .page-hero, .page-body, button { display: none !important; }
  .calc { display: block; }
  .calc-result { box-shadow: none; position: static; }
}

/* ---------- Header fit and language handling ---------- */
/* Languages move to the footer below 400px so the header fits a 360px phone. */
.footer-lang { display: none; gap: 8px; margin: 0; }
.footer-lang a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.footer-lang a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.footer-lang a.active { color: #fff; background: rgba(255, 255, 255, 0.16); }

@media (max-width: 400px) {
  .lang-switcher { display: none; }
  .footer-lang { display: flex; }
}

/* ---------- Cookie consent banner & footer link ---------- */
.btn-link.footer-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  text-decoration: none;
}
.btn-link.footer-cookie-btn:hover {
  color: #fff;
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 16px 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.cookie-banner[hidden] {
  display: none !important;
}
.cookie-banner-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
  min-width: 260px;
}
.cookie-banner-text a {
  color: #fff;
  text-decoration: underline;
}
.cookie-banner-text a:hover {
  color: #d0e1ff;
}
.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-banner-actions .btn {
  font-size: 0.875rem;
  padding: 8px 18px;
  min-width: 80px;
  text-align: center;
}
.cookie-banner-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.cookie-banner-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
@media (max-width: 600px) {
  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .cookie-banner-actions .btn {
    flex: 1;
  }
}

/* ---------- Kalkulator hub: eyebrow contrast ---------- */
.kalkulator-hub .eyebrow { color: #a63d00; }
