:root {
  /* Colors */
  --color-background: #0f1012; /* deep charcoal */
  --color-surface: #181a1e;
  --color-surface-muted: #22252b;
  --color-text: #f7f5f2; /* clean white / soft light */
  --color-text-muted: #c0c3ca;
  --color-primary: #ff5a55; /* vibrant coral */
  --color-primary-soft: rgba(255, 90, 85, 0.12);
  --color-success: #3ccf91;
  --color-warning: #ffb545;
  --color-danger: #ff4b6a;
  --color-beige: #e3d7c7; /* soft beige */
  --color-gray-50: #f7f7f7;
  --color-gray-100: #ededed;
  --color-gray-200: #d9d9de;
  --color-gray-300: #c0c3ca; /* cool gray */
  --color-gray-400: #9a9eaa;
  --color-gray-500: #757988;
  --color-gray-600: #565a68;
  --color-gray-700: #3a3d49;
  --color-gray-800: #262833;
  --color-gray-900: #14151b;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --font-size-xs: 0.75rem;  /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem;     /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.375rem; /* 22px */
  --font-size-2xl: 1.75rem; /* 28px */
  --font-size-3xl: 2.25rem; /* 36px */
  --font-size-4xl: 3rem;    /* 48px */
  --font-size-5xl: 3.75rem; /* 60px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-7: 1.75rem;  /* 28px */
  --space-8: 2rem;     /* 32px */
  --space-9: 2.5rem;   /* 40px */
  --space-10: 3rem;    /* 48px */
  --space-11: 3.5rem;  /* 56px */
  --space-12: 4rem;    /* 64px */
  --space-16: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (subtle but atmospheric) */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.26);
  --shadow-soft-high: 0 18px 55px rgba(0, 0, 0, 0.35);
  --shadow-outline: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 4px rgba(255, 90, 85, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-med: 220ms cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 380ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: 1.5rem;
}

/* ========================================
   Reset / Normalize
   ======================================== */

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

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

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

button {
  border: none;
  padding: 0;
  background: none;
}

a {
  color: inherit;
}

/* Remove tap highlight on mobile for a more immersive feel */

* {
  -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Base Styles
   ======================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.5rem, 4vw, var(--font-size-5xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(2rem, 3vw, var(--font-size-4xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2.4vw, var(--font-size-3xl));
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

h6 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

a {
  text-decoration: none;
  color: var(--color-primary);
  position: relative;
  transition: color var(--transition-med);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15em;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--transition-med);
}

a:hover::after,
a:focus-visible::after {
  width: 100%;
}

hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: var(--space-6) 0;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* ========================================
   Accessibility & Motion
   ======================================== */

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-outline);
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ========================================
   Utilities
   ======================================== */

/* Layout container */

.container {
  width: 100%;
  max-width: calc(var(--layout-max-width) + var(--layout-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.gap-xs {
  gap: var(--space-2);
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

/* Spacing utilities (common) */

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-xs { margin-top: var(--space-2) !important; }
.mb-xs { margin-bottom: var(--space-2) !important; }
.mt-sm { margin-top: var(--space-3) !important; }
.mb-sm { margin-bottom: var(--space-3) !important; }
.mt-md { margin-top: var(--space-4) !important; }
.mb-md { margin-bottom: var(--space-4) !important; }
.mt-lg { margin-top: var(--space-6) !important; }
.mb-lg { margin-bottom: var(--space-6) !important; }

.pt-section {
  padding-top: var(--space-10);
}

.pb-section {
  padding-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .pt-section {
    padding-top: var(--space-12);
  }
  .pb-section {
    padding-bottom: var(--space-12);
  }
}

/* Screen reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Components
   ======================================== */

/* Buttons */

.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  --btn-bg: var(--color-primary);
  --btn-color: #0f1012;
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: linear-gradient(135deg, var(--btn-bg), #ff796f);
  color: var(--btn-color);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background var(--transition-med),
    transform var(--transition-fast),
    box-shadow var(--transition-med),
    opacity var(--transition-fast);
}

.button::before,
button::before,
input[type="button"]::before,
input[type="submit"]::before,
input[type="reset"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.24), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.button:hover::before,
button:hover::before,
input[type="button"]:hover::before,
input[type="submit"]:hover::before,
input[type="reset"]:hover::before {
  opacity: 1;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0);
  box-shadow: none;
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.button--ghost {
  --btn-bg: transparent;
  --btn-color: var(--color-text);
  --btn-border: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.02);
}

.button--ghost::before {
  display: none;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.button--secondary {
  --btn-bg: var(--color-gray-800);
  --btn-color: var(--color-text);
  background: linear-gradient(135deg, #262833, #1b1d23);
}

/* Form inputs */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(10, 11, 15, 0.9);
  color: var(--color-text);
  outline: none;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-gray-500);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: rgba(255, 90, 85, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 3px rgba(255, 90, 85, 0.3);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input[disabled],
textarea[disabled],
select[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Card */

.card {
  background: radial-gradient(circle at top left, rgba(255, 90, 85, 0.06), transparent 55%),
    linear-gradient(145deg, var(--color-surface), var(--color-surface-muted));
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(227, 215, 199, 0.08), transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card--muted {
  background: linear-gradient(145deg, #14151b, #1b1d23);
  box-shadow: none;
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-gray-400);
}

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

/* Media emphasis (portfolio imagery) */

.media-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #050608;
  box-shadow: var(--shadow-soft-high);
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: auto;
  display: block;
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0%, rgba(255, 90, 85, 0.24), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 767.98px) {
  h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  h2 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }

  .card {
    padding: var(--space-5);
  }

  .container {
    padding-inline: 1.25rem;
  }
}

@media (min-width: 1200px) {
  :root {
    --layout-max-width: 1200px;
  }
}
