/* ==========================================================================
   DESIGN MEDIAN STUDIO — Base / reset / typography / utilities
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  /* Horizontal reveal transforms can otherwise create a few px of sideways scroll.
     clip avoids creating a scroll container, so sticky positioning still works. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}

/* Theme transition on all surfaces */
body,
.header,
.card,
.surface,
footer,
.btn,
input,
textarea,
select {
  transition: background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

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

img {
  height: auto;
}

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

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

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

::selection {
  background: var(--brand-orange);
  color: #080808;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-orange);
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 4px;
  border-radius: 3px;
}

/* ==========================================================================
   Layout utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(5rem, 10vw, var(--sp-10));
}

.section--tight {
  padding-block: clamp(3.5rem, 6vw, var(--sp-8));
}

.section--top {
  padding-top: calc(var(--header-h) + clamp(3rem, 7vw, 7rem));
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 6rem);
  align-items: start;
}

.split--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split--aside {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack--sm {
  gap: var(--sp-3);
}
.stack--md {
  gap: var(--sp-5);
}
.stack--lg {
  gap: var(--sp-7);
}

/* Section heading group */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-orange);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-size: var(--fs-2xl);
  max-width: 18ch;
}

.section-title--wide {
  max-width: 26ch;
}

.lead {
  font-size: var(--fs-md);
  color: var(--text-soft);
  max-width: 58ch;
  line-height: 1.7;
}

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

.accent {
  color: var(--brand-orange);
}

.text-display {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.visually-hidden {
  position: absolute !important;
  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: -100px;
  left: 1rem;
  z-index: 10000;
  background: var(--brand-orange);
  color: #080808;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus {
  top: 1rem;
}

/* Decorative divider */
.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* Grain overlay applied to hero/atmospheric sections */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--noise-opacity);
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
