@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* Colors */
  --color-canvas: #fafafa;
  --color-canvas-elevated: #ffffff;
  --color-canvas-sunken: #f4f4f5;
  --color-ink: #09090b;
  --color-ink-darker: #18181b;
  --color-ink-dark: #27272a;
  --color-ink-medium: #71717a;
  --color-ink-light: #a1a1aa;
  --color-ink-lighter: #d4d4d8;
  --color-ink-lightest: #e4e4e7;
  --color-ink-inverted: #ffffff;

  --color-link: #bf4f24;
  --color-link-hover: #a03020;
  --color-positive: #0b6125;
  --color-negative: #b52a1d;
  --color-selected: #f5e1d8;
  --color-selected-dark: #9a3f1c;
  --color-highlight: #fbbf24;

  /* Brand gradient - warm earth tones inspired by Dawn theme */
  --gradient-brand: linear-gradient(
    135deg,
    #bf4f24 0%,
    #d97a4e 50%,
    #e8a88a 100%
  );
  --gradient-brand-subtle: linear-gradient(
    135deg,
    rgba(191, 79, 36, 0.08) 0%,
    rgba(232, 168, 138, 0.04) 100%
  );
  --gradient-shine: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0) 60%
  );

  /* Spacing */
  --inline-space: 1ch;
  --inline-space-half: calc(var(--inline-space) / 2);
  --inline-space-double: calc(var(--inline-space) * 2);
  --block-space: 1rem;
  --block-space-half: calc(var(--block-space) / 2);
  --block-space-double: calc(var(--block-space) * 2);

  /* Typography */
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --font-mono: ui-monospace, monospace;

  --text-small: 0.875rem;
  --text-normal: 1rem;
  --text-medium: 1.125rem;
  --text-large: 1.5rem;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-glow-terracotta: 0 0 20px rgba(191, 79, 36, 0.3);
  --shadow-glow-green: 0 0 20px rgba(5, 150, 105, 0.3);

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 99rem;

  /* Layout */
  --nav-height: 5rem;

  /* Focus rings */
  --focus-ring-color: var(--color-link);
  --focus-ring-offset: 2px;
  --focus-ring-size: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-canvas: #09090b;
    --color-canvas-elevated: #111113;
    --color-canvas-sunken: #050506;
    --color-ink: #fafafa;
    --color-ink-darker: #f4f4f5;
    --color-ink-dark: #e4e4e7;
    --color-ink-medium: #a1a1aa;
    --color-ink-light: #71717a;
    --color-ink-lighter: #3f3f46;
    --color-ink-lightest: #27272a;
    --color-ink-inverted: #09090b;

    --color-link: #d97a4e;
    --color-link-hover: #e8a88a;
    --color-positive: #34d399;
    --color-negative: #f87171;
    --color-selected: #4a2515;
    --color-selected-dark: #bf4f24;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5), 0 10px 10px rgba(0, 0, 0, 0.3);
  }
}

html {
  font-size: 100%;
  background-color: var(--color-canvas);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

@media (hover: hover) {
  body {
    background-attachment: fixed;
  }
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 120ms ease-out;
}

@media (hover: hover) {
  a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
  }
}

/* Focus styles */
:is(a, button, input, textarea):focus-visible {
  border-radius: var(--radius-sm);
  outline: var(--focus-ring-size) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Disabled states */
:is(button, input, textarea)[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-ink);
  font-weight: 700;
  line-height: 1.2;
  margin: 1rem 0 1rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

h2 {
  font-size: var(--text-medium);
}

h2 mark {
  --circled-color: var(--color-highlight);
  --circled-padding: -0.5ch;

  background: none;
  color: inherit;
  position: relative;
  white-space: nowrap;
}

h2 mark span {
  opacity: 0.5;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  h2 mark span {
    mix-blend-mode: screen;
  }
}

h2 mark span::before,
h2 mark span::after {
  border: 2px solid var(--circled-color);
  content: "";
  inset: var(--circled-padding);
  position: absolute;
}

h2 mark span::before {
  border-inline-end: none;
  border-radius: 100% 0 0 75% / 50% 0 0 50%;
  inset-block-start: calc(var(--circled-padding) / 2);
  inset-inline-end: 50%;
}

h2 mark span::after {
  border-inline-start: none;
  border-radius: 0 100% 75% 0 / 0 50% 50% 0;
  inset-inline-start: 30%;
}

/* Images */
img {
  display: block;
  max-width: 100%;
}

/* Selection */
::selection {
  background: var(--color-selected);
  color: var(--color-link);
}

/* Highlight - SVG-based marker effect with mask */
.highlight {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding: 0 0.5em;
}

.highlight svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.highlight span {
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  .highlight svg path[fill="#F5E642"] {
    fill: #b8860b !important;
  }

  .highlight svg path[fill="#C8B800"] {
    fill: #8b6914 !important;
  }
}
