/* nickgallo.dev: light, airy, photo-led design system */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #23221f;
  --muted: #77736c;
  --line: #e7e3dc;
  --accent: #b5654a;          /* alpine-glow terracotta */
  --wash: rgba(250, 249, 247, 0.62);
  --shadow: 0 1px 2px rgba(35, 34, 31, 0.04), 0 8px 24px rgba(35, 34, 31, 0.06);
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614;
    --surface: #201f1c;
    --ink: #ece8e1;
    --muted: #a39e95;
    --line: #34322d;
    --accent: #e08a6c;
    --wash: rgba(23, 22, 20, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-weight: 400; line-height: 1.25; margin: 0 0 0.6em; }

p { margin: 0 0 1em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

::selection { background: var(--accent); color: #fff; }

/* ---------- type helpers ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(30px, 6vw, 58px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0.3em 0;
}

.serif { font-family: var(--serif); }

.section-title {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 56px);
}
.section-title h2 {
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 300;
  margin: 0.4em 0 0;
}
.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 18px auto 0;
}

/* ---------- layout ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section + .section { padding-top: 0; }

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-size: 14px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 400;
}
.nav { display: flex; gap: clamp(14px, 2.4vw, 30px); align-items: center; }
.nav a {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: 10px; margin-right: -10px; }
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block; width: 22px; height: 1px; background: var(--ink); position: relative; content: "";
}
.nav-toggle-label span::before { position: absolute; top: -7px; }
.nav-toggle-label span::after { position: absolute; top: 7px; }

@media (max-width: 760px) {
  .nav-toggle-label { display: block; }
  .nav {
    position: absolute; top: 64px; 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 0.3s ease;
  }
  .nav a { width: 100%; text-align: center; padding: 14px 0; border: 0; }
  .nav-toggle:checked ~ .nav { max-height: 420px; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: grid;
  place-items: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--wash);
  z-index: -1;
}
.hero.short { min-height: min(52vh, 460px); }
.hero .eyebrow { color: var(--ink); }
.hero-inner { padding: 80px var(--gutter); max-width: 820px; }
.hero p.lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 24px);
  color: var(--ink);
  margin: 0.4em 0 1.6em;
}

/* ---------- buttons ---------- */

.btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 13px 28px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.card {
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
a.card:hover { transform: translateY(-4px); color: inherit; }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
a.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 22px 24px 26px; }
.card-body h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 6px 0 8px;
}
.card-body p { color: var(--muted); font-size: 15px; margin: 0; }

/* masonry for photo galleries */
.masonry { columns: 3 300px; column-gap: clamp(16px, 2.4vw, 28px); }
.masonry figure {
  break-inside: avoid;
  margin: 0 0 clamp(16px, 2.4vw, 28px);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.masonry figure a { display: block; overflow: hidden; }
.masonry figure img { width: 100%; transition: transform 0.6s ease; }
.masonry figure a:hover img { transform: scale(1.03); }
.masonry figcaption { padding: 14px 18px 16px; }
.masonry figcaption strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.masonry figcaption span { color: var(--muted); font-size: 14px; }

/* ---------- résumé timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.timeline > li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 6px; }
.timeline h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; margin: 0; }
.timeline .role { color: var(--accent); font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; margin: 4px 0 12px; }
.timeline ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.timeline ul li { margin: 4px 0; }
@media (max-width: 680px) {
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stat {
  background: var(--surface);
  padding: 28px 20px;
  text-align: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
}
.stat span { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

/* ---------- misc ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.split img { box-shadow: var(--shadow); }

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

.contact-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-band .email {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 40px);
  text-decoration: none;
  margin: 0.15em 0 0.35em;
}
/* A banded section has its own background, so it always keeps its top padding. */
.section + .section.contact-band { padding-top: clamp(56px, 9vw, 112px); }

/* generic content pages (polls, contacts, privacy, etc.) */
.page { padding: clamp(40px, 7vw, 88px) 0; }
.page h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 300;
  text-align: center;
  margin-bottom: 1.4em;
}
.page input[type="text"], .page input[type="email"], .page input[type="password"],
.page input[type="number"], .page input[type="date"], .page input[type="url"],
.page textarea, .page select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 12px;
  width: 100%;
  max-width: 420px;
  margin: 4px 0 14px;
}
.page input[type="submit"], .page button {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 12px 26px;
  cursor: pointer;
}
.page input[type="submit"]:hover, .page button:hover { background: var(--ink); color: var(--bg); }

/* ---------- footer ---------- */

.site-footer { padding: 48px 0 56px; text-align: center; font-size: 13px; color: var(--muted); }
.site-footer .links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.site-footer a { text-decoration: none; letter-spacing: 0.2em; text-transform: uppercase; font-size: 11px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- playground demos ---------- */

.demo { padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }
.demo-head { text-align: center; margin-bottom: clamp(24px, 4vw, 40px); }
.demo-head .back { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.demo-head h1 {
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 300;
  margin: 14px 0 10px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.demo-card { background: var(--surface); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.demo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.demo input[type="text"], .demo input[type="url"], .demo input[type="date"], .demo select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); padding: 10px 12px; min-width: 0;
}
.demo input:focus, .demo select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.demo .grow { flex: 1 1 220px; }
.demo .btn { padding: 11px 22px; }
.demo .note { color: var(--muted); font-size: 14px; text-align: center; margin-top: 18px; }
.demo .error { color: var(--accent); text-align: center; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chip { font-size: 12px; text-transform: capitalize; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.list-reset { list-style: none; margin: 0; padding: 0; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--ink); }

/* featured project card spans two columns on wide screens */
@media (min-width: 1000px) {
  .cards.projects { grid-template-columns: repeat(3, 1fr); grid-auto-flow: row dense; }
  .cards.projects .card.wide { grid-column: span 2; }
  .cards.projects .card.wide .card-img { aspect-ratio: auto; height: 100%; min-height: 300px; }
  .cards.projects .card.wide .card-img img { object-position: center top; }
  .cards.projects .card.wide { display: grid; grid-template-columns: 2fr 1fr; }
  .cards.projects .card.wide .card-body { align-self: center; }
}

/* what I do: SEO / AEO / GEO / AIO */
.disciplines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.discipline { background: var(--surface); padding: 28px 24px 30px; }
.discipline b { display: block; font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1; color: var(--accent); }
.discipline h3 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 400; margin: 12px 0 10px; }
.discipline p { color: var(--muted); font-size: 15px; margin: 0; }

/* latest project feature */
.feature { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--surface); box-shadow: var(--shadow); }
.feature-img { display: block; overflow: hidden; background: var(--line); }
.feature-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .6s ease; }
.feature-img:hover img { transform: scale(1.03); }
.feature-body { padding: clamp(24px, 4vw, 44px); align-self: center; }
.feature-body h3 { font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 500; margin: 6px 0 10px; }
.feature-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.feature-form input { flex: 1 1 200px; font: inherit; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.feature-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 800px) { .feature { grid-template-columns: 1fr; } .feature-img img { aspect-ratio: 4 / 3; } }
