/* Serenspark Brand Design System v0.2 - approved design foundations. */
/* Only the browser's root size establishes rem. Respect user preferences and zoom. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&family=Noto+Sans+Sinhala:wght@400;500;600;700&family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap');

:root {
  --brand-forest: #285943;
  --brand-evergreen: #305C50;
  --brand-deep-forest: #23452C;
  --color-bg: #FFFFFF;
  --color-bg-muted: #F6F8F5;
  --color-surface: #FFFFFF;
  --color-text: #202825;
  --color-text-muted: #526458;
  --color-border: #D9E4DD;
  --color-action: #285943;
  --color-action-hover: #23452C;
  --color-on-action: #FFFFFF;
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter','Noto Sans Sinhala','Noto Sans Tamil',sans-serif;

  /* All site typography is rem-based. Fluid type replaces per-device font-size overrides. */
  --text-xs: .875rem;
  --text-sm: 1rem;
  --text-body: clamp(1.0625rem, 1rem + .24vw, 1.125rem);
  --text-h3: clamp(1.4375rem, 1.32rem + .54vw, 1.625rem);
  --text-h2: clamp(1.75rem, 1.43rem + 1.45vw, 2.125rem);
  --text-h1: clamp(2rem, 1.62rem + 1.72vw, 2.75rem);
  --text-display: clamp(2.375rem, 1.48rem + 4vw, 3.75rem);
  --line-body: 1.5;
  --line-heading: 1.2;

  /* 4px design rhythm expressed in rem, not fixed pixels. */
  --space-0: 0;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --radius-sm: .5rem;
  --radius-md: .75rem;
  --radius-lg: 1.25rem;
  --content-width: 75rem;
  --reading-width: 68ch;
  --page-gutter: clamp(1.25rem, .8rem + 1.5vw, 3rem);
  --section-gap: clamp(3.5rem, 2.3rem + 3.5vw, 6rem);
}

[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #101916;
  --color-bg-muted: #1A2A22;
  --color-surface: #1A2A22;
  --color-text: #EAF3ED;
  --color-text-muted: #B9D0C2;
  --color-border: #385347;
  --color-action: #A2D0B2;
  --color-action-hover: #B9E0C6;
  --color-on-action: #101916;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 100%; /* Never set an absolute px root or use 62.5%. */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-body);
  color: var(--color-text);
  background: var(--color-bg);
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--line-heading);
  letter-spacing: -.018em;
  overflow-wrap: break-word;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
.display { font-size: var(--text-display); }
p { max-width: var(--reading-width); }
:lang(si), :lang(si) h1, :lang(si) h2, :lang(si) h3 {
  font-family: 'Noto Sans Sinhala', sans-serif;
  letter-spacing: normal;
}
:lang(ta), :lang(ta) h1, :lang(ta) h2, :lang(ta) h3 {
  font-family: 'Noto Sans Tamil', sans-serif;
  letter-spacing: normal;
}
:lang(si), :lang(ta) { word-break: normal; hyphens: none; }
/* If complex-script marks clip in a specific context, adjust that component after native-script QA. */
a { color: var(--color-action); text-underline-offset: .18em; }
:focus-visible { outline: .1875rem solid var(--color-action); outline-offset: .25rem; }
.container {
  width: min(calc(100% - 2 * var(--page-gutter)), var(--content-width));
  margin-inline: auto;
}
.reading { max-width: var(--reading-width); }
.section { padding-block: var(--section-gap); }
.brand-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3rem;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  color: var(--color-on-action);
  background: var(--color-action);
  font: 600 var(--text-sm)/1.5 var(--font-body);
  text-decoration: none;
  border: 0;
}
.brand-button:hover { background: var(--color-action-hover); }
.brand-button:focus-visible { outline: .1875rem solid var(--color-text); outline-offset: .1875rem; }
/* Breakpoints are for layout shifts, not re-declaring fonts per screen. Use em for media queries. */
@media (max-width: 55em) {
  .two-column { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
