/* ======================================================
   Personaelit — Base Styles
   Reset, base elements, and global styles
   ====================================================== */

/* ------------------------------
   Global capabilities
-------------------------------- */
:root {
  color-scheme: light dark;
}

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

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

body {
  margin: 0;
  min-block-size: 100svh;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% -10%,
      color-mix(in oklab, var(--accent) 15%, transparent),
      transparent 60%),
    /* radial-gradient(1000px 700px at 85% -15%,
      color-mix(in oklab, var(--link) 15%, transparent),
      transparent 60%), */
    var(--bg);
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ------------------------------
   Layout primitives
-------------------------------- */
.backdrop {
  min-block-size: 100svh;
  display: flex;
  flex-direction: column;
}

.container {
  inline-size: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
  padding-block: var(--s-12);
}

/* ------------------------------
   Text & headings
-------------------------------- */
h1, h2, h3 {
  line-height: 1.2;
  margin-block: 0 var(--s-4);
}

h1 {
  font-size: clamp(2rem, 3.5vw + .5rem, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.75rem);
  font-weight: 600;
  margin-block-start: var(--s-8);
}

p {
  margin-block: 0 var(--s-4);
}

.lead {
  font-size: clamp(1.05rem, 1.2vw + .8rem, 1.25rem);
  color: var(--muted);
  max-inline-size: 58ch;
}

/* ------------------------------
   Links, focus, selection
-------------------------------- */
a {
  color: var(--link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: color-mix(in oklab, var(--accent) 30%, transparent);
}

/* ------------------------------
   Utilities
-------------------------------- */
.hr {
  block-size: 1px;
  background: var(--border);
  margin-block: var(--s-8);
}

[hidden] {
  display: none !important;
}

/* ------------------------------
   Section rhythm
-------------------------------- */
main > section {
  position: relative;
  scroll-margin-block-start: calc(var(--header-h) + 1rem);
}

main > section + section::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: color-mix(in oklab, var(--border) 70%, transparent);
  opacity: .4;
}

@media (prefers-color-scheme: dark) {
  main > section + section::before {
    background: linear-gradient(
      90deg,
      color-mix(in oklab, var(--accent) 25%, transparent),
      color-mix(in oklab, var(--link) 25%, transparent)
    );
    opacity: .25;
  }
}
