/* ===========================
   DESIGN SYSTEM VARIABLES
=========================== */

:root {
  /* light mode: warm cream */
  --bg: #D9CFC4;

  /* softened glass surfaces */
  --surface: rgba(244, 238, 228, 0.62);
  --surface-alt: rgba(232, 224, 211, 0.72);
  --surface-glass: rgba(248, 242, 232, 0.48);

  --text: #2C2825;
  --text-muted: #6B5F57;

  --accent: #14967D;
  --accent-strong: #0F735F;
  --accent-soft: rgba(20, 150, 125, 0.10);

  --accent-warm: #C96F1D;
  --accent-warm-strong: #9F5512;
  --accent-warm-soft: rgba(201, 111, 29, 0.10);

  --border: rgba(44, 40, 37, 0.13);
  --shadow: rgba(44, 40, 37, 0.16);

  --radius: 10px;
  --max-width: 1200px;

  --spacing-lg: 60px;
  --spacing-md: 30px;
  --spacing-sm: 15px;
}
/* ===========================
   GLOBAL BASE
=========================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Work Sans", sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  opacity: 1;
  transition:
    background-color .25s ease,
    color .25s ease,
    opacity .35s ease;
}

#wrapper {
  opacity: 0;
}

body.is-ready #wrapper {
  opacity: 1;
  filter: none;
}

.ambient-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  contain: layout paint style;
}

.ambient-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.ambient-background::after {
  background:
    linear-gradient(180deg, rgba(217,207,196,0.10), rgba(217,207,196,0.24)),
    radial-gradient(circle at center, transparent 0, rgba(217,207,196,0.22) 74%);
}

.ambient-background__canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.90;
}

body.dark-mode .ambient-background {
  filter: none;
}

body.dark-mode .ambient-background::after {
  background:
    linear-gradient(180deg, rgba(16,24,32,0.18), rgba(16,24,32,0.38)),
    radial-gradient(circle at center, transparent 0, rgba(16,24,32,0.30) 74%);
}

body.is-leaving {
  opacity: 1;
}

h1,
h2,
h3,
h4,
h5 {
  margin-top: 0;
  font-family: "Quicksand", sans-serif;
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2.1rem;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

h1 + p {
  margin-top: .5rem;
}

h2 + p,
h3 + p {
  margin-top: .4rem;
}

/* ===========================
   LINKS
=========================== */

a {
  font-family: "Quicksand", sans-serif;
  color: var(--text);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--accent-strong);
}

a:visited {
  color: var(--text);
}

a span,
a p {
  color: var(--text);
}

/* ===========================
   MEDIA DEFAULTS
=========================== */

img,
video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

pre,
code {
  font-family: 'Courier New', 'Consolas', monospace;
}

pre {
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .95rem;
}

body:not(.dark-mode) pre {
  background: #EDE8E1;
  color: #2C2825;
  border: 1px solid rgba(44, 40, 37, 0.18);
  box-shadow: 0 4px 12px rgba(44, 40, 37, 0.08);
}

/* ===========================
   DARK MODE THEME
=========================== */



body.dark-mode {
  --bg: #101820;
  --surface: #172532;
  --surface-alt: #203647;

  --text: #F1F5F5;
  --text-muted: #AAB8C0;

  --accent: #1ABC9C;
  --accent-strong: #0E8F78;
  --accent-soft: rgba(26, 188, 156, 0.10);

  --accent-warm: #D9822B;
  --accent-warm-strong: #B8661D;
  --accent-warm-soft: rgba(217, 130, 43, 0.10);

  --border: rgba(241, 245, 245, 0.09);
  --shadow: rgba(0, 0, 0, 0.36);

  background:
    radial-gradient(circle at top left, rgba(26,188,156,0.045), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(217,130,43,0.025), transparent 26rem),
    linear-gradient(180deg, #101820 0%, #14202B 100%);
  color: var(--text);
}

.dark-mode pre {
  background: #0b0b0c;
  color: #ececec;
  border: 1px solid #111;
}

/* ===========================
   GLOBAL MOTION
=========================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sectionIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

a,
button {
  transition:
    transform .22s cubic-bezier(.2,.8,.2,1),
    box-shadow .24s cubic-bezier(.2,.8,.2,1),
    background-color .24s ease,
    border-color .24s ease,
    color .24s ease,
    opacity .24s ease,
    filter .24s ease;
}

a:active,
button:active {
  transform: scale(.97);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  body,
  main,
  section {
    opacity: 1 !important;
    transform: none !important;
  }

}

@media (max-width: 700px), (max-height: 640px) {
  .ambient-background {
    display: none;
  }
}
