/* ---------------------------------------------------
   Tokens (from the original Figma Make theme)
--------------------------------------------------- */
:root {
  --surface: #0d0d0d;
  --surface-mid: #161616;
  --surface-raised: #1e1e1e;
  --coral: #ff4d2e;
  --coral-dim: #cc3a20;
  --sand: #e8e0d4;
  --muted: #6b6b6b;
  --hairline: #2a2a2a;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  --max-width: 1280px;
}

/* ---------------------------------------------------
   Base
--------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--sand);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--coral); color: var(--surface); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button, select, input, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 16px;
}

/* ---------------------------------------------------
   Nav
--------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 300ms ease, border-color 300ms ease;
}
.nav.is-scrolled {
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--hairline);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sand);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 200ms ease;
}
.nav-links a:hover { color: var(--sand); }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral);
  border: 1px solid var(--coral);
  padding: 8px 16px;
  transition: background-color 200ms ease, color 200ms ease;
}
.nav-cta:hover { background: var(--coral); color: var(--surface); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--sand);
  transition: transform 300ms ease, opacity 300ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translateY(5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translateY(-5px); }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sand);
}

/* ---------------------------------------------------
   Hero
--------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 128px 24px 64px;
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; width: 100%; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: end;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1;
  font-size: clamp(3rem, 8vw, 7.5rem);
  color: var(--sand);
  margin-bottom: 32px;
}
.hero-rotating {
  color: var(--coral);
  font-style: italic;
}
.hero-sub {
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--muted);
}
.hero-stats {
  display: flex;
  gap: 24px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  color: var(--sand);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.hero-services {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-services span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
}

/* ---------------------------------------------------
   Section shared
--------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--sand);
  line-height: 1.1;
}
.section-note {
  max-width: 20rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: right;
}

/* ---------------------------------------------------
   Projects
--------------------------------------------------- */
.projects { padding: 96px 24px; }
.projects-inner { max-width: var(--max-width); margin: 0 auto; }
.project-row {
  border-top: 1px solid var(--hairline);
  cursor: pointer;
}
.project-list-end { border-top: 1px solid var(--hairline); }
.project-row-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "index title year"
    "cat cat cat"
    "desc desc desc";
  gap: 8px 24px;
  padding: 32px 0;
}
.project-index { grid-area: index; font-family: var(--font-mono); font-size: 0.75rem; color: var(--hairline); }
.project-title {
  grid-area: title;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.75rem;
  color: var(--sand);
  transition: color 300ms ease;
}
.project-category { grid-area: cat; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.05em; color: var(--muted); }
.project-desc { grid-area: desc; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.project-year { grid-area: year; font-family: var(--font-mono); font-size: 0.75rem; color: var(--hairline); transition: color 300ms ease; justify-self: end; }

.project-row:hover .project-title { color: var(--coral); font-style: italic; }
.project-row:hover .project-year { color: var(--coral); }

.project-preview {
  position: relative;
  overflow: hidden;
  max-height: 0;
  transition: max-height 500ms ease;
}
.project-row:hover .project-preview { max-height: 340px; }
.project-preview img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  filter: brightness(0.75);
}
.project-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(13,13,13,0.8) 0%, transparent 60%);
}
.project-preview-overlay span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral);
}

/* ---------------------------------------------------
   Portfolio
--------------------------------------------------- */
.portfolio { padding: 96px 24px; background: var(--surface-mid); }
.portfolio-inner { max-width: var(--max-width); margin: 0 auto; }
.section-head-simple { margin-bottom: 48px; }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}
.filter-tab {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 200ms ease;
}
.filter-tab.is-active {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--surface);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.portfolio-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-raised);
  aspect-ratio: 4 / 3;
}
.portfolio-card.is-tall { aspect-ratio: 4 / 5; }
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  transition: transform 700ms ease;
}
.portfolio-card:hover img { transform: scale(1.05); }
.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.8) 0%, transparent 60%);
  transition: background 300ms ease;
}
.portfolio-card:hover .portfolio-overlay {
  background: linear-gradient(to top, rgba(255,77,46,0.7) 0%, transparent 60%);
}
.portfolio-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
}
.portfolio-info h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--sand);
  margin-bottom: 8px;
  transition: font-style 300ms ease;
}
.portfolio-card:hover .portfolio-info h3 { font-style: italic; }
.portfolio-tags { display: flex; gap: 8px; }
.portfolio-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 300ms ease;
}
.portfolio-card:hover .portfolio-tags span { color: var(--surface); }

.portfolio-card[hidden] { display: none; }

/* ---------------------------------------------------
   Contact
--------------------------------------------------- */
.contact { padding: 96px 24px; background: var(--surface); }
.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.15;
  font-size: clamp(2.5rem, 4vw, 4rem);
  color: var(--sand);
  margin-bottom: 32px;
}
.contact-title em { font-style: italic; }
.contact-lede { font-size: 0.9rem; line-height: 1.6; color: var(--muted); margin-bottom: 40px; }

.contact-facts { display: flex; flex-direction: column; gap: 16px; }
.contact-fact { border-top: 1px solid var(--hairline); padding-top: 16px; }
.contact-fact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.contact-fact-value { font-size: 0.9rem; color: var(--sand); }

.contact-form { display: flex; flex-direction: column; gap: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--sand);
  outline: none;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 200ms ease;
}
.form-field select option { background: var(--surface-mid); }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--coral); }
.form-field textarea { resize: none; }

.submit-btn {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--coral);
  color: var(--surface);
  border: none;
  padding: 16px 32px;
  cursor: pointer;
  transition: background-color 200ms ease;
}
.submit-btn:hover { background: var(--coral-dim); }

.contact-thanks-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 300;
  font-style: italic;
  color: var(--coral);
  margin-bottom: 24px;
}
.contact-thanks p { font-size: 0.9rem; line-height: 1.6; color: var(--muted); margin-bottom: 32px; }
.contact-thanks-reset {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral);
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------------------------------------------------
   Footer
--------------------------------------------------- */
.footer { border-top: 1px solid var(--hairline); padding: 32px 24px; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.footer-social { display: flex; gap: 24px; }
.footer-social a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 200ms ease;
}
.footer-social a:hover { color: var(--coral); }

/* ---------------------------------------------------
   Responsive (md breakpoint ~768px, matching Tailwind)
--------------------------------------------------- */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }

  .hero { padding-left: 40px; padding-right: 40px; }
  .hero-inner { }
  .hero-grid { grid-template-columns: 9fr 3fr; }
  .hero-stats { flex-direction: column; align-items: flex-end; gap: 24px; }

  .projects { padding-left: 40px; padding-right: 40px; }
  .section-note { display: block; }
  .project-row-top {
    grid-template-columns: 1fr 4fr 2fr 4fr 1fr;
    grid-template-areas: "index title cat desc year";
    align-items: center;
  }
  .project-desc { max-width: 100%; }

  .portfolio { padding-left: 40px; padding-right: 40px; }
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .lg-offset { margin-top: 0; }

  .contact { padding-left: 40px; padding-right: 40px; }
  .contact-inner { grid-template-columns: 5fr 7fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }

  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 1024px) {
  .lg-offset { margin-top: 40px; }
}

@media (max-width: 767px) {
  .project-row-top { padding: 24px 0; }
}
