/* ==========================================================================
   DigitalProfile.lk — Base
   Font loading, reset, elements, layout primitives, utilities, motion.
   ========================================================================== */

/* ---- Fonts (self-hosted, variable) ------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
}

body {
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  overflow-x: hidden;
  transition: background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}

img,
svg,
video,
canvas,
picture {
  display: block;
  max-width: 100%;
}

img,
video { height: auto; }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

p,
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[class],
ol[class] { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }

:target { scroll-margin-top: calc(var(--header-height) + var(--space-8)); }

::selection {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}


/* ---- Typographic elements ---------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tighter);
}
h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tighter);
}
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-h5); font-weight: var(--weight-semibold); }

p { text-wrap: pretty; }

strong, b { font-weight: var(--weight-semibold); }


/* ---- Accessibility helpers --------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text-on-accent);
  background: var(--color-accent-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(-160%);
  transition: transform var(--duration-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}


/* ---- Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

.section { padding-block: var(--space-section); position: relative; }
.section--sm { padding-block: var(--space-section-sm); }
.section--flush-top { padding-block-start: 0; }

/* Full-bleed band that escapes the container it sits in */
.bleed {
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.stack > * + * { margin-block-start: var(--flow, var(--space-4)); }

.grid { display: grid; gap: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}


/* ---- Section headers ----------------------------------------------------- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 44rem;
}
.section-head--center {
  align-items: center;
  text-align: center;
  margin-inline: auto;
}
.section-head__title { font-size: var(--text-h2); }
.section-head__lede {
  font-size: var(--text-xl);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
}
.section-head--center .eyebrow::before { display: none; }


/* ---- Text helpers --------------------------------------------------------- */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--color-text-muted); }
.lede {
  font-size: var(--text-xl);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}


/* ---- Decorative background ------------------------------------------------ */
.mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.9;
  will-change: transform;
}
.mesh__blob--1 {
  width: 46rem; height: 46rem;
  top: -22rem; right: -14rem;
  background: var(--mesh-blob-1);
  animation: drift-a 26s var(--ease-in-out) infinite alternate;
}
.mesh__blob--2 {
  width: 38rem; height: 38rem;
  top: 48rem; left: -18rem;
  background: var(--mesh-blob-2);
  animation: drift-b 32s var(--ease-in-out) infinite alternate;
}
.mesh__blob--3 {
  width: 32rem; height: 32rem;
  bottom: -14rem; right: -8rem;
  background: var(--mesh-blob-3);
  animation: drift-a 36s var(--ease-in-out) infinite alternate-reverse;
}

/* Everything above the mesh */
.site-header,
.site-main,
.site-footer { position: relative; z-index: var(--z-base); }

.hairline {
  height: 1px;
  border: 0;
  background: var(--gradient-hairline);
}


/* ---- Motion -------------------------------------------------------------- */
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-5rem, 4rem, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(5rem, -4rem, 0) scale(1); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes float-y-sm {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.75); opacity: 0.8; }
  75%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Scroll-reveal — progressive enhancement, visible by default without JS */
.reveal { --reveal-delay: 0ms; }
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--duration-slow) var(--ease-out) var(--reveal-delay),
              transform var(--duration-slow) var(--ease-out) var(--reveal-delay);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
