/* ============================================================
   Sean Flax — portfolio
   Palette drawn from the slate-blue studio portrait.
   ============================================================ */
:root {
  --bg:        #fbfaf7;   /* warm paper */
  --bg-alt:    #f2f0ea;   /* subtle band */
  --ink:       #1a1e26;   /* near-black slate */
  --muted:     #5d6472;   /* secondary text */
  --faint:     #8a909c;
  --accent:    #3f5266;   /* slate blue */
  --accent-2:  #55708a;
  --line:      rgba(26, 30, 38, 0.12);
  --card:      #ffffff;
  --shadow:    0 1px 2px rgba(26,30,38,.05), 0 18px 40px -24px rgba(26,30,38,.35);
  --maxw:      1180px;
  --serif:     "Fraunces", Georgia, "Times New Roman", serif;
  --sans:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 3px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 250, 247, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500; font-size: 1.15rem; letter-spacing: .16em;
  text-transform: uppercase;
}
.nav-menu {
  list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0;
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
}
.nav-menu a { color: var(--muted); transition: color .2s; }
.nav-menu a:hover { color: var(--ink); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  color: #fff;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(24,32,44,.82) 0%, rgba(24,32,44,.45) 42%, rgba(24,32,44,.05) 72%),
    linear-gradient(0deg, rgba(20,26,36,.7) 0%, rgba(20,26,36,0) 45%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}
.eyebrow {
  font-size: .78rem; letter-spacing: .28em; text-transform: uppercase;
  font-weight: 600; color: #cdd6e2; margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: .98; letter-spacing: .02em;
  margin: 0 0 1.1rem;
  text-transform: uppercase;
}
.hero-tagline {
  font-size: clamp(1.05rem, 2.3vw, 1.4rem);
  max-width: 34ch; margin: 0 0 2rem; color: #eef1f5; line-height: 1.5;
}
.hero-about { display: flex; flex-direction: column; gap: 1rem; max-width: 54ch; }
.hero-about p {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  margin: 0; color: #eef1f5; line-height: 1.6;
}
.hero-about strong { color: #fff; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.6rem; border-radius: 999px;
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
  border: 1.5px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #fff; color: var(--ink); }
.btn-primary:hover { background: #eef1f5; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: 6.5rem 1.5rem;
}
.section-tight { padding-top: 1rem; }
.section-label {
  font-size: .76rem; letter-spacing: .28em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-2); margin: 0 0 1.1rem;
}
.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 4.3vw, 3rem); line-height: 1.1;
  letter-spacing: -.01em; margin: 0 0 2.5rem; max-width: 20ch;
}
.section-label-sub { margin: -1.9rem 0 2.5rem; }

/* ---------- About ---------- */
.about { background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%); }
.about-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about .section-title { margin-bottom: 0; }
.about-body { display: flex; flex-direction: column; gap: 1.15rem; }
.about-body p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.about-body strong { color: var(--ink); font-weight: 600; }

/* ---------- Work grid ---------- */
.work-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem 1.6rem;
}
.work-grid-3 { grid-template-columns: repeat(3, 1fr); }

.work-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s;
}
.work-card:hover { transform: translateY(-5px); box-shadow: 0 2px 4px rgba(26,30,38,.06), 0 30px 55px -28px rgba(26,30,38,.5); }
.work-link { display: flex; flex-direction: column; flex: 1; color: inherit; }
.work-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.work-card:hover .work-media img { transform: scale(1.045); }
.work-body { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; }
.work-role {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-2); margin: 0;
}
.work-name {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.3rem; line-height: 1.2; margin: 0; letter-spacing: -.01em;
}
.work-desc { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  border-top: 1px solid var(--line);
}
.contact .section-label { color: var(--accent-2); }
.contact-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.08; margin: 0 auto .9rem;
  letter-spacing: -.01em;
}
.contact-sub { color: var(--muted); max-width: 46ch; margin: 0 auto 2.2rem; font-size: 1.08rem; }
.contact-email {
  display: inline-block;
  font-family: var(--serif); font-size: clamp(1.5rem, 4.5vw, 2.4rem); font-weight: 400;
  color: var(--accent); padding-bottom: 2px;
}
.contact-org {
  margin: 2rem 0 0; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d7dbe2; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.5rem 1.5rem; display: flex; flex-wrap: wrap; gap: 1.2rem 2rem;
  align-items: center; justify-content: center;
}
.site-footer .wordmark { color: #fff; }
.footer-links {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
}
.footer-links a { color: #aeb5c1; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.copyright { width: 100%; margin: 0; text-align: center; font-size: .8rem; color: #7c8393; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.work-grid .work-card:nth-child(2).reveal { transition-delay: .06s; }
.work-grid .work-card:nth-child(3).reveal { transition-delay: .12s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .work-grid, .work-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about .section-title { max-width: 24ch; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: .4rem;
  }
  .nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-menu.open { max-height: 320px; }
  .nav-menu li { border-top: 1px solid var(--line); }
  .nav-menu a { display: block; padding: 1rem 1.5rem; }
  .section { padding: 4.5rem 1.5rem; }
  .hero-inner { padding-bottom: 3.5rem; }
}

@media (max-width: 540px) {
  .work-grid, .work-grid-3 { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}
