/* ───────────────────────────────────────────────
   Varlia Legal Site — Premium Redesign
   Backend JS files are NOT modified.
   ─────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: dark light;
  --navy: #060e1f;
  --navy-soft: #0b1630;
  --navy-mid: #101e3d;
  --line: rgba(46, 78, 126, 0.35);
  --line-hover: rgba(32, 201, 151, 0.45);
  --mint: #a6f4d0;
  --teal: #20c997;
  --teal-glow: rgba(32, 201, 151, 0.12);
  --teal-glow-strong: rgba(32, 201, 151, 0.22);
  --text: #f0f5fa;
  --muted: #8fa3c4;
  --surface: rgba(14, 25, 52, 0.72);
  --surface-raised: rgba(18, 32, 62, 0.8);
  --control: rgba(20, 38, 70, 0.85);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 60px rgba(32, 201, 151, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --max-width: 760px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(32, 201, 151, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(45, 100, 220, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(32, 201, 151, 0.03) 0%, transparent 70%);
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── Links ──────────────────────────────────── */

a {
  color: var(--mint);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--teal);
}
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Header ─────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 14, 31, 0.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

.bar, main, .site-footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.bar {
  min-height: 72px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

/* ── Brand / Logo ───────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none !important;
  color: var(--text);
  font-size: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  transition: opacity var(--transition);
}
.brand:hover { opacity: 0.85; color: var(--text); text-decoration: none !important; }

.brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* When using SVG mark, hide it; we now use the wordmark PNG */
.brand img[src="varlia-mark.svg"] {
  height: 32px;
  width: 32px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ── Navigation ─────────────────────────────── */

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
}

nav a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  transition: all var(--transition);
  text-decoration: none !important;
  font-weight: 500;
}
nav a:hover {
  color: var(--text);
  background: var(--teal-glow);
  text-decoration: none !important;
}
nav a[aria-current="page"] {
  color: var(--teal);
  font-weight: 700;
  background: var(--teal-glow);
}

/* ── Main Content ───────────────────────────── */

main { padding: 60px 0 80px; }

/* ── Eyebrow ────────────────────────────────── */

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── Headings ───────────────────────────────── */

h1, h2, h3 {
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 {
  max-width: 18ch;
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 900;
  margin: 0.3rem 0 1rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--mint) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2.4rem 0 0.6rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.4rem 0 0.35rem;
}

p, li { max-width: 72ch; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 60ch; line-height: 1.7; }
.date { color: var(--muted); font-size: 0.92rem; font-weight: 500; }

/* ── Card Grid ──────────────────────────────── */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin: 40px 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  padding: 26px;
  color: var(--text);
  text-decoration: none !important;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--teal-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  border-color: var(--line-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  text-decoration: none !important;
}

.card:hover::before { opacity: 1; }

.card strong {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--mint);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Card icon arrows */
.card::after {
  content: '→';
  position: absolute;
  bottom: 22px;
  right: 22px;
  color: var(--teal);
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition);
}
.card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ── Notice ─────────────────────────────────── */

.notice {
  margin: 2rem 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(32, 201, 151, 0.06), var(--surface));
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  backdrop-filter: blur(12px);
}

/* ── Contact Section ────────────────────────── */

.contact {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* ── Footer ─────────────────────────────────── */

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--mint); }

/* ── Policy Pages ───────────────────────────── */

.policy-page { width: min(calc(100% - 40px), 980px); }

.policy-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  margin-bottom: 40px;
  padding: clamp(28px, 5vw, 48px);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

/* Decorative gradient orb in hero */
.policy-hero::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, var(--teal-glow-strong) 0%, transparent 70%);
  pointer-events: none;
}

.policy-hero h1 { max-width: none; }
.policy-hero .lead { margin-bottom: 12px; }

/* ── Language Picker ────────────────────────── */

.language-picker {
  display: grid;
  gap: 8px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-picker select {
  width: 100%;
  min-height: 48px;
  padding: 0 38px 0 16px;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.93rem;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238fa3c4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.language-picker select:hover {
  border-color: var(--teal);
}
.language-picker select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-color: var(--teal);
}

/* ── Policy Sections ────────────────────────── */

.policy-sections { display: grid; gap: 14px; }

.policy-section {
  padding: clamp(22px, 4vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}
.policy-section:hover {
  border-color: rgba(46, 78, 126, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.policy-section h2 {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 0 0 12px;
}

.policy-section h2 span {
  color: var(--teal);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 2ch;
}

.policy-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.policy-section p + p { margin-top: 12px; }
.policy-section ul {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}
.policy-section li + li { margin-top: 8px; }

.notice-card {
  background: linear-gradient(145deg, rgba(32, 201, 151, 0.09), var(--surface));
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
}

/* ── Entrance Animations ────────────────────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main { animation: fadeIn 0.5s ease-out; }

.policy-hero {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.policy-section {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Stagger policy sections */
.policy-section:nth-child(1) { animation-delay: 0.1s; }
.policy-section:nth-child(2) { animation-delay: 0.15s; }
.policy-section:nth-child(3) { animation-delay: 0.2s; }
.policy-section:nth-child(4) { animation-delay: 0.25s; }
.policy-section:nth-child(5) { animation-delay: 0.3s; }
.policy-section:nth-child(6) { animation-delay: 0.35s; }
.policy-section:nth-child(7) { animation-delay: 0.4s; }
.policy-section:nth-child(8) { animation-delay: 0.45s; }
.policy-section:nth-child(9) { animation-delay: 0.5s; }
.policy-section:nth-child(10) { animation-delay: 0.55s; }
.policy-section:nth-child(11) { animation-delay: 0.6s; }
.policy-section:nth-child(12) { animation-delay: 0.65s; }
.policy-section:nth-child(13) { animation-delay: 0.7s; }
.policy-section:nth-child(14) { animation-delay: 0.75s; }

.card {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.card:nth-child(1) { animation-delay: 0.15s; }
.card:nth-child(2) { animation-delay: 0.25s; }
.card:nth-child(3) { animation-delay: 0.35s; }

/* ── Light Mode ─────────────────────────────── */

@media (prefers-color-scheme: light) {
  :root {
    --navy: #f5f8f7;
    --navy-soft: #ffffff;
    --navy-mid: #eef3f1;
    --line: rgba(0, 80, 60, 0.12);
    --line-hover: rgba(7, 138, 103, 0.35);
    --mint: #05704f;
    --teal: #078a67;
    --teal-glow: rgba(7, 138, 103, 0.07);
    --teal-glow-strong: rgba(7, 138, 103, 0.12);
    --text: #0e1f1a;
    --muted: #4a6058;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-raised: rgba(248, 252, 250, 0.85);
    --control: rgba(255, 255, 255, 0.9);
    --shadow: 0 24px 64px rgba(20, 55, 45, 0.1);
    --shadow-card: 0 8px 32px rgba(20, 55, 45, 0.06);
    --shadow-glow: 0 0 60px rgba(7, 138, 103, 0.06);
  }

  h1, h2, h3 { color: var(--text); }
  h1 {
    background: linear-gradient(135deg, var(--text) 0%, var(--teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  a:hover { color: #054d38; text-decoration-color: var(--teal); }

  .site-header {
    background: rgba(245, 248, 247, 0.85);
  }

  body::before {
    background:
      radial-gradient(ellipse 80% 50% at 20% 0%, rgba(7, 138, 103, 0.05) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 100%, rgba(45, 100, 220, 0.03) 0%, transparent 50%);
  }

  .language-picker select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%234a6058' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ── Responsive ─────────────────────────────── */

@media (max-width: 640px) {
  .bar {
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .cards { grid-template-columns: 1fr; }

  main { padding-top: 40px; }

  .policy-page { width: min(calc(100% - 24px), 980px); }

  .policy-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .language-picker { min-width: 0; }

  .policy-section { border-radius: 15px; }

  nav {
    width: 100%;
    gap: 4px;
  }

  nav a {
    padding: 5px 10px;
    font-size: 0.84rem;
  }

  .brand img { height: 26px; }
}
