/* ==========================================================================
   BASE, TYPOGRAPHY SCALE, CONTAINERS & MAGNETIC BUTTON SYSTEM
   ========================================================================== */

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

html {
  background-color: var(--color-dark);
  -webkit-text-size-adjust: 100%;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.15vw, 19px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.theme-dark {
  background-color: var(--color-dark);
  color: var(--color-text-light);
}

body.nav-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

h1, h2, h3, h4, h5, h6, p, figure, ul, ol, dl, dd {
  margin: 0;
}

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

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

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

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.theme-dark :focus-visible,
.theme-dark-section :focus-visible {
  outline-color: var(--color-mist);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 9999;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: var(--color-dark);
  color: var(--color-text-light);
  transform: translateY(-220%);
  transition: transform 0.25s var(--ease-primary);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Typography Scale (calibrated to Dennis Snellenberg) ---------- */

h1, h2, h3, h4 {
  font-weight: 400;
  letter-spacing: -0.028em;
}

h1 {
  font-size: calc(clamp(3em, 6.8vw, 7.2em) * 0.875);
  line-height: 1.055;
}

h2 {
  font-size: calc(clamp(2.75em, 4.8vw, 4.4em) * 0.8);
  line-height: 1.065;
}

h3 {
  font-size: clamp(2.1em, 4vw, 4.25em);
  line-height: 1.08;
}

h4 {
  font-size: clamp(1.35em, 2.1vw, 2.25em);
  line-height: 1.38;
  letter-spacing: -0.02em;
}

h5 {
  font-size: 0.65em;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

p {
  font-size: 1em;
  line-height: 1.66;
}

p.big {
  font-size: clamp(1.08em, 1.35vw, 1.25em);
  line-height: 1.55;
}

p.small {
  font-size: 0.84em;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--color-muted);
}

.theme-dark .muted,
.theme-dark-section .muted {
  color: var(--color-text-light-muted);
}

/* ---------- Containers & Structural Hairlines ---------- */

.section {
  position: relative;
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
  background-color: var(--color-paper);
}

.section.theme-dark-section {
  background-color: var(--color-dark);
  color: var(--color-text-light);
}

.container {
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  max-width: 100em;
  width: 100%;
}

.container.medium {
  padding-left: calc(var(--container-padding) * 1.65);
  padding-right: calc(var(--container-padding) * 1.65);
}

.container.small {
  padding-left: calc(var(--container-padding) * 2.2);
  padding-right: calc(var(--container-padding) * 2.2);
}

.container.no-padding {
  padding-left: unset;
  padding-right: unset;
}

.stripe {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}

.theme-dark .stripe,
.theme-dark-section .stripe {
  background-color: var(--color-border-light);
}

.once-in {
  will-change: transform, opacity;
}

/* ---------- Signature Dennis Buttons (Pill + Magnetic Circle) ---------- */

.btn {
  display: inline-flex;
  position: relative;
  z-index: 5;
  border: 0;
  outline: 0;
}

.btn-click {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 2.25em;
  height: 4.15em;
  padding: 0 2.35em;
  box-shadow: inset 0 0 0 1px var(--color-border);
  background-color: transparent;
  color: var(--color-ink);
  transition: color 0.24s var(--ease-smooth), box-shadow 0.24s var(--ease-smooth), background-color 0.24s var(--ease-smooth);
  will-change: transform;
  cursor: pointer;
}

.btn-fill {
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  border-radius: 50%;
  background-color: var(--color-accent);
  transform: translate3d(0, 76%, 0);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

.btn-text {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  font-size: 0.96em;
  font-weight: 450;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

.btn-text .count-nr {
  font-size: 0.68em;
  opacity: 0.62;
  transform: translateY(-0.55em);
  margin-left: 0.08em;
  transition: opacity 0.3s ease;
}

.btn-click:hover,
.btn-click.is-hovered {
  color: var(--color-text-light);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.btn-click:hover .count-nr,
.btn-click.is-hovered .count-nr {
  opacity: 0.85;
}

/* Dark / Active pill variant */
.btn-dark .btn-click,
.btn-click.active {
  background-color: var(--color-dark);
  color: var(--color-text-light);
  box-shadow: inset 0 0 0 1px var(--color-dark);
}

.btn-dark .btn-fill,
.btn-click.active .btn-fill {
  background-color: var(--color-accent);
}

.btn-click.active:hover,
.btn-click.active.is-hovered {
  color: var(--color-text-light);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* Light outline pill (used on dark navy sections/footer) */
.btn-light-outline .btn-click {
  color: var(--color-text-light);
  box-shadow: inset 0 0 0 1px var(--color-border-light);
}

.btn-light-outline .btn-fill {
  background-color: var(--color-accent);
}

.btn-light-outline .btn-click:hover {
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* Circular Magnetic CTA Button (About me / Get in touch / Live site / Send it!) */
.btn-round .btn-click {
  width: clamp(8.5em, 11.5vw, 11em);
  height: clamp(8.5em, 11.5vw, 11em);
  border-radius: 50%;
  padding: 0;
  background-color: var(--color-dark);
  color: var(--color-text-light);
  box-shadow: none;
}

.btn-round .btn-fill {
  background-color: var(--color-accent);
}

.btn-round.btn-accent .btn-click {
  background-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(211, 230, 235, 0.22);
}

.btn-round.btn-accent .btn-fill {
  background-color: var(--color-accent-bright);
}

.btn-round.btn-small .btn-click {
  width: clamp(6.2em, 8vw, 7.6em);
  height: clamp(6.2em, 8vw, 7.6em);
}

/* Circular Icon Toggle Button (List / Grid view on /work) */
.btn-icon .btn-click {
  width: 4.15em;
  height: 4.15em;
  padding: 0;
  border-radius: 50%;
}

.btn-icon svg {
  width: 1.15em;
  height: 1.15em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* Inline Link with Dennis Hover Dot / Underline */
.btn-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.4em 0;
  font-size: 0.96em;
  transition: opacity 0.3s var(--ease-primary);
}

.btn-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
  transform: translate(-50%, 0.45em) scale(0);
  transition: transform 0.3s var(--ease-primary);
}

.btn-link:hover::after,
.btn-link.active::after {
  transform: translate(-50%, 0.45em) scale(1);
}

.text-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--color-accent);
  font-weight: 500;
}

.text-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-primary);
}

.text-underline:hover::after {
  transform-origin: left center;
  transform: scaleX(1);
}

/* Diagonal Arrow */
.arrow-diag {
  display: inline-flex;
  width: 1em;
  height: 1em;
  transition: transform 0.4s var(--ease-primary);
}

.arrow-diag svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
