/* ==================================================
   DESIGN TOKENS
   ================================================== */

:root {
  /* ==================== PRIMITIVES ==================== */

  /* Colors: gradients */
  --color-bg-dark: linear-gradient(
    180deg,
    #5d4540 0%,
    #513c37 35%,
    #49342f 70%,
    #3e2b27 100%
  );
  --color-bg-light: linear-gradient(
    to bottom,
    #f9f6f1 0%,
    #f4efe7 60%,
    #eae4db 100%
  );
  --color-bg-accent: linear-gradient(
    135deg,
    #d8bd8a 0%,
    #b89563 50%,
    #8f6b3f 100%
  );

  /* Colors: solid */
  --color-dark: #513c37;
  --color-light: #edd9b4;
  --color-accent: #b89563;
  --color-muted: #8a7a6b;
  --color-light-soft: color-mix(
    in srgb,
    var(--color-light) 75%,
    var(--color-muted)
  );
  --color-light-faint: color-mix(in srgb, var(--color-light) 12%, transparent);

  /* Typography */
  --font-size-base: clamp(0.875rem, 0.838rem + 0.185vw, 1rem);
  --font-weight-normal: 400;
  --font-family-primary: system-ui, Arial, sans-serif;

  /* Spacing */
  --space-xs: clamp(0.25rem, 0.176rem + 0.37vw, 0.5rem);
  --space-s: clamp(0.5rem, 0.426rem + 0.37vw, 0.75rem);
  --space-m: clamp(1rem, 0.852rem + 0.741vw, 1.5rem);
  --space-l: clamp(1.5rem, 1.204rem + 1.481vw, 2.5rem);
  --space-xl: clamp(2rem, 1.407rem + 2.963vw, 4rem);

  /* ==================== DERIVED ==================== */

  /* Border */
  --border-width: 1px;
  --border-radius: 4px;
  --border: var(--border-width) solid var(--color-accent);

  /* Motion */
  --transition-hover: 0.2s ease;
  --lift-hover: -2px;

  /* Header */
  --header-height: 64px;

  /* Section */
  --section-padding: var(--space-m);

  /* Container */
  --container-width: 1400px;
  --container-padding: var(--space-m);
}

/* Users who asked for less motion get instant state changes and no lift */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-hover: 0s;
    --lift-hover: 0px;
  }
}

/* ==================================================
   RESET
   ================================================== */

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

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

/* ==================================================
   BASE
   ================================================== */

html {
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100dvh;
  margin: 0;

  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;

  background: var(--color-bg-light);
}

/* ==================================================
   TYPOGRAPHY
   ================================================== */

h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-weight: 400;
  color: var(--color-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: var(--space-m);
}

h1 {
  font-size: clamp(2rem, 1.704rem + 1.481vw, 3rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 1.278rem + 1.111vw, 2.25rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.25rem, 1.102rem + 0.741vw, 1.75rem);
  line-height: 1.3;
}

h4 {
  font-size: clamp(1.125rem, 1.051rem + 0.37vw, 1.375rem);
  line-height: 1.4;
}

p {
  font-size: clamp(1rem, 0.963rem + 0.185vw, 1.125rem);
}

/* ==================================================
   MEDIA
   ================================================== */

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

/* ==================================================
   LAYOUT
   ================================================== */

/* Main area: space below the fixed header, centered column */
.site-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: var(--header-height);
}

.section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-block: var(--space-l);
  padding-inline: var(--section-padding);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-block: var(--space-l);
  padding-inline: var(--container-padding);
  border: var(--border);
  border-radius: var(--border-radius);
}

/* ==================================================
   COMPONENTS
   ================================================== */

/* Shared button: light face, dark gradient fades in on hover, focus and
   .is-active. Browsers cannot animate between two gradients, so the dark
   layer lives in ::before and only its opacity is transitioned. */
.btn {
  position: relative;
  isolation: isolate;
  color: var(--color-dark);
  background: var(--color-bg-light);
  border: var(--border);
  border-radius: var(--border-radius);
  text-decoration: none;
  cursor: pointer;
  transition:
    color var(--transition-hover),
    transform var(--transition-hover);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* inner curve of the border, so no light gap shows in the corners */
  border-radius: calc(var(--border-radius) - var(--border-width));
  background: var(--color-bg-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-hover);
}

.btn:hover,
.btn:focus-visible,
.btn.is-active {
  color: var(--color-light);
}

.btn:hover::before,
.btn:focus-visible::before,
.btn.is-active::before {
  opacity: 1;
}

/* Optional lift for standalone link buttons */
.btn--lift:hover {
  transform: translateY(var(--lift-hover));
}

/* Back-to-homepage link (about, legal pages): layout only, look comes from .btn */
.home-btn {
  display: inline-block;
  padding: var(--space-s) var(--space-l);
}

/* ==================================================
   UTILITIES
   ================================================== */

.section__title {
  text-align: center;
  color: var(--color-dark);
}

/* Hidden on screen, still read by screen readers and search engines */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==================================================
   ACCESSIBILITY
   ================================================== */

/* Smooth scrolling only for users who did not ask for less motion */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

:focus-visible {
  outline: 2px solid var(--color-dark);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-light);
}
