/* Base Styles: 
Depends on tokens.css (must be loaded first in html) 
*/

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box; /* padding and border including in width calculation */
  margin: 0;
  padding: 0;
}

/* ROOT */
html {
  font-size: 16px; /* 1rem = 16px */
  scroll-behavior: smooth; /* smooth scrolling when clicking on links */
  -webkit-font-smoothing: antialiased; /* crisper fonts on Mac/iOS */
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: var(--leading-normal);
  overflow-x: hidden;
}

/* ELEMENTS */
img,
video {
  display: block; /* removes the small gap under images */
  max-width: 100%; /* images never overflow their containers */
  height: auto;
}

a {
  color: inherit; /* links inherit their parent's color */
  text-decoration: none;
}

ul,
ol {
  list-style: none; /* removes bullets and numbers */
}

button {
  font-family: inherit; /* buttons use the page font, not browser default */
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
}

/* LAYOUT
.container centers content and adds side padding.
clamp(min, preferred, max) - preferred scales with viewport 
*/
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto; /* centers the container */
  padding-inline: var(--gutter);
}

.container-narrow {
  max-width: var(--container-nnarrow);
}

/* TYPOGRAPHY 
These are reusable classes applied directly in the HTML.
e.g. <h1 class="display display--1">Heading</h1>
*/
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

/* clamp(minimum, fluid, maximum) - font scales between breakpoints */
.display--1 {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl));
}
.display--2 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
}
.display--3 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
}
.display--4 {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
}

.label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.label--brand {
  color: var(--color-brand);
}
.label--gold {
  color: var(--color-gold);
}

.body-text {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--color-text-secondary);
}

.body-text--sm {
  font-size: var(--text-sm);
}

/* HORIZONTAL RULE */
.rule {
  height: 0.5px;
  background-color: var(--color-border);
  border: none;
}

/* BUTTONS 
Base .btn class + modifier classes like .btn--primary
This pattern is called BEM - Block Element Modifier */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-standard);
}

.btn--primary {
  background-color: var(--color-brand);
  color: var(--color-text-inverse);
  border: 1px solid transparent;
}

.btn--primary:hover {
  background-color: var(--color-brand-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 0.5px solid var(--color-border-strong);
}

.btn--secondary:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  padding-inline: 0;
  border-radius: 0;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.btn--ghost:hover {
  color: var(--color-brand);
}

.btn--lg {
  font-size: var(--text-sm);
  padding: var(--space-4) var(--space-8);
}

/* IMAGE UTILITIES */
img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills container without stretching */
  display: block;
}

/* VISUALLY HIDDEN 
Hides content visually but keeps it readable by screen readers.
Used for accessibility — e.g. aria labels inside buttons.
*/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* PAGE TRANSITION OVERLAY 
A white panel that covers the page during navigation.
JS animates it in and out to create a smooth page change feel.
*/
.page-transition {
  position: fixed;
  inset: 0; /* shorthand for top/right/bottom/left: 0 */
  background: var(--color-bg);
  z-index: var(--z-modal);
  pointer-events: none;
  transform-origin: bottom;
  transform: scaleY(0);
}

/* RESPONSIVE 
Mobile-first adjustments go here as we build.
We add more as we need them. 
*/
@media (max-width: 480px) {
  .btn--lg {
    font-size: var(--text-xs);
    padding: var(--space-3) var(--space-6);
  }
}
