/* =========================================================
   Portfolio — Mobile-first stylesheet
   Brand palette: Deep Teal + Muted Gold + Silver + Charcoal
   ========================================================= */

/* ------------------------------
   0) Design Tokens
---------------------------------*/
:root {
  --bg: #0b0d10;
  --surface: #12161a;
  --surface-2: #171c22;
  --text: #e6ecf2;
  --muted: #9aa5b1;

  /* Brand palette */
  --brand: #005058;      /* Deep Teal */
  --accent-1: #CBB26A;   /* Muted Gold */
  --accent-2: #EAEAEA;   /* Soft Silver Grey */
  --neutral-dark: #1A1A1A; /* Charcoal Black */

  --radius: 1.25rem;
  --radius-sm: .75rem;

  --container: 1100px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);

  --header-h: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f6f7f9;
    --surface-2: #eef1f6;
    --text: #1c2127;
    --muted: #5b6775;
  }
}

/* ------------------------------
   1) Base Reset
---------------------------------*/
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 80% -20%, rgba(0,80,88,.10), transparent 60%),
    var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--header-h); /* ensure fixed header doesn’t cover content */
}

/* Media defaults */
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ------------------------------
   2) Typography & Utilities
---------------------------------*/
.h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3.25rem); line-height: 1.15; margin: 0 0 .5rem; }
.h2 { font-size: clamp(1.5rem, 1.8vw + 1rem, 2.25rem); margin: 0 0 .25rem; }
.h4 { font-size: 1.125rem; margin: 0 0 .25rem; }
.h5 { font-size: 1rem; margin: 0; }
.lead { font-size: clamp(1rem, .6vw + .9rem, 1.25rem); color: var(--muted); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.accent { color: var(--accent-1); }

a { color: inherit; }

.sr-only {
  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: absolute; left: -999px; top: -999px;
}
.skip-link:focus {
  left: 1rem; top: 1rem; background: var(--accent-1); color: #111;
  padding: .5rem .75rem; border-radius: .5rem; z-index: 999;
}

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.section { padding: 64px 0; }
.section.alt {
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.03) 30%, transparent 100%);
}
.section__head { margin-bottom: 1.25rem; }

/* ------------------------------
   3) Header & Navigation
---------------------------------*/
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(18,22,26,0.95);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: .2px;
}
.brand__logo { width: 36px; height: 36px; }
.brand__name { font-size: 1.05rem; }

.nav-toggle {
  inline-size: 42px; block-size: 42px; border-radius: 10px;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle__bar {
  width: 20px; height: 2px; background: currentColor; position: relative; display: block; transition: background .2s ease;
}
.nav-toggle__bar::before, .nav-toggle__bar::after {
  content: ""; position: absolute; inset-inline-start: 0; width: 20px; height: 2px; background: currentColor; transition: transform .2s ease;
  top: 0;
}
.nav-toggle__bar::before { transform: translateY(-6px); }
.nav-toggle__bar::after  { transform: translateY(6px); }

.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: rotate(-45deg); }

.nav {
  position: fixed; inset: var(--header-h) 0 auto 0;
  background: var(--surface);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform .24s ease;
}
.nav[aria-hidden="true"]  { transform: scaleY(0); }
.nav[aria-hidden="false"] { transform: scaleY(1); }
.nav[data-open="true"] { transform: scaleY(1); }

.nav__list { list-style: none; margin: 0; padding: .5rem; display: grid; gap: .25rem; }
.nav__link {
  display: block; padding: .9rem 1rem; border-radius: .75rem;
  text-decoration: none; color: #fff;
}
.nav__link:is(:hover, :focus-visible) { background: var(--surface-2); }

.nav__link.active {
  color: var(--accent-1);
  background: rgba(203,178,106,0.15);
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav { position: static; transform: none !important; background: transparent; border: 0; }
  .nav__list { display: flex; gap: .25rem; padding: 0; }
  .nav__link { padding: .6rem .85rem; }
}

/* ------------------------------
   4) Hero
---------------------------------*/
.hero { padding-top: 32px; }
.hero--bg { position: relative; min-height: clamp(480px, 75vh, 960px); display: flex; align-items: center; }
.hero__grid { display: grid; gap: 1.25rem; align-items: center; }
.hero__text { max-width: 650px; }
.hero__cta { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg picture, .hero__bg img { width: 100%; height: 100%; object-fit: cover; }

.hero--bg::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0.40) 40%, rgba(0,0,0,0.30) 100%);
  pointer-events: none;
}
.hero--bg .container { position: relative; z-index: 1; }

.hero--bg .h1,
.hero--bg .lead,
.hero--bg .btn--ghost { color: #fff; }
.hero--bg .lead { color: #e7ebf2; }

/* ------------------------------
   5) Cards, Grids, Buttons
---------------------------------*/
.cards { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 1rem;
}

.grid { display: grid; gap: 1rem; }
.grid--work { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--work { grid-template-columns: repeat(3, 1fr); } }

.work-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: clip;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.work-card img { display: block; width: 100%; height: auto; }
.work-card figcaption { padding: .75rem 1rem; color: var(--neutral-dark); }

.about { display: grid; gap: 1rem; align-items: center; }
.about__img { width: 100%; max-width: 380px; border-radius: var(--radius); box-shadow: var(--shadow); }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.1fr .9fr; }
  .about { grid-template-columns: .95fr 1.05fr; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; border-radius: 999px; padding: .7rem 1rem;
  border: 1px solid rgba(255,255,255,.15); text-decoration: none; cursor: pointer;
  min-width: 44px; min-height: 44px;
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  border: none;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--accent-1); /* Muted Gold on hover */
  color: #0b0d10;
}


.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--accent-2);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--accent-2);
  color: var(--neutral-dark);
}

/* ------------------------------
   6) Forms
---------------------------------*/
.form { display: grid; gap: .8rem; }
.form__row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form__row { grid-template-columns: 1fr 1fr; } }

.form__label { display: grid; gap: .35rem; font-weight: 600; }
.input, .textarea {
  width: 100%; padding: .8rem .9rem; border-radius: .85rem;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--surface); color: var(--text);
}
.textarea { resize: vertical; }

/* ------------------------------
   7) Footer
---------------------------------*/
.site-footer { padding: 40px 0; border-top: 1px solid rgba(255,255,255,.08); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.to-top { color: var(--accent-1); text-decoration: none; }

/* ------------------------------
   8) Animations
---------------------------------*/
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.is-visible,
.reveal.in-view { opacity: 1; transform: none; transition: opacity 500ms ease, transform 500ms ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-visible, .reveal.in-view { transition: none; transform: none !important; }
}

/* ------------------------------
   9) Section: Selected Work
---------------------------------*/
#work.section {
  background: var(--brand);
  color: var(--accent-2);
}
#work .h2,
#work .h5,
#work p,
#work .muted { color: var(--accent-2); }
#work .work-card { background: #fff; }
#work .work-card figcaption h3 { color: var(--neutral-dark); }
#work .work-card figcaption p { color: #333; }

/* ------------------------------
   10) Misc polish
---------------------------------*/
@media (hover: hover) {
  a:hover { text-decoration: none; }
}
