/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Colors */
  --color-bg:           #F8F5F0;
  --color-text:         #1C1916;
  --color-text-muted:   #5C5650;
  --color-border:       #E4DDD6;
  --color-surface:      #EEE9E3;

  /* Typography */
  --font-body:          'Averia Serif Libre', serif;
  --font-display:       'Aboreto', cursive;
  --font:               'Averia Serif Libre', serif;
  --text-hero:          clamp(48px, 8vw, 96px);
  --text-h1:            clamp(32px, 5vw, 56px);
  --text-h2:            clamp(24px, 3vw, 36px);
  --text-h3:            20px;
  --text-body:          17px;
  --text-small:         14px;
  --text-label:         12px;

  /* Spacing */
  --space-section:      clamp(60px, 10vw, 120px);
  --space-content:      clamp(24px, 4vw, 48px);
  --max-width:          1200px;
  --content-width:      720px;
  --wide-width:         1000px;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  animation: pageFadeIn 200ms ease forwards;
}

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

/* Hide broken images gracefully - show surface colour instead */
img:not([src]),
img[src=""] {
  visibility: hidden;
}
img:-moz-broken { visibility: hidden; }

.project-card__image-wrap img[alt] {
  color: transparent; /* hides alt text when broken */
  background: var(--color-surface);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 768px) {
  .container { padding-inline: 40px; }
}

@media (min-width: 1024px) {
  .container { padding-inline: 48px; }
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */
.label {
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================
   NAVIGATION
   ============================================ */

/* Spacer so fixed nav doesn't overlap content */
#nav-placeholder {
  height: 76px;
  flex-shrink: 0;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 28px 0;
  background: var(--color-bg);
  transition: background 300ms ease, box-shadow 300ms ease, padding 300ms ease;
}

.nav--scrolled {
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--color-border), 0 4px 24px rgba(28, 25, 22, 0.06);
  padding: 16px 0;
}

.nav__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 768px) {
  .nav__container { padding-inline: 40px; }
}

@media (min-width: 1024px) {
  .nav__container { padding-inline: 48px; }
}

.nav__logo {
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.12em;
}

.nav__links {
  display: none;
  gap: 40px;
}

@media (min-width: 1024px) {
  .nav__links { display: flex; }
}

.nav__links a {
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-text-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 200ms ease;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 250ms ease;
}

.nav__links a:hover { color: var(--color-text); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--color-text); }

.nav__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .nav__hamburger { display: none; }
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--color-text);
  transition: transform 250ms ease, opacity 250ms ease;
}

.nav__overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.nav__overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav__overlay-close {
  position: absolute;
  top: 28px;
  right: 24px;
  font-size: 20px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-text-muted);
}

.nav__overlay-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.nav__overlay-links a {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-text);
  transition: color 200ms ease;
}

.nav__overlay-links a:hover { color: var(--color-text-muted); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 48px 0;
  margin-top: var(--space-section);
  border-top: 1px solid var(--color-border);
}

.footer__container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 768px) {
  .footer__container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-inline: 40px;
  }
}

@media (min-width: 1024px) {
  .footer__container { padding-inline: 48px; }
}

.footer__name {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.footer__links a,
.footer__links span {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  transition: color 200ms ease;
}

.footer__links a:hover { color: var(--color-text); }

/* ============================================
   PROJECT GRID & CARDS
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

.project-card {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

@media (hover: hover) {
  .project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
  }
}

.project-card__image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface);
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

@media (hover: hover) {
  .project-card:hover .project-card__image { transform: scale(1.04); }
}

.project-card__info {
  padding: 20px 24px 24px;
}

.project-card__meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.project-card__year,
.project-card__industry {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.project-card__tagline {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================
   SECTION HEADING
   ============================================ */
.section-label {
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 40px;
}

/* ============================================
   PAGE HEADER (Work, About, Contact)
   ============================================ */
.page-header {
  padding-top: 80px;
  padding-bottom: var(--space-section);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-section);
}

.page-header__title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.page-header__sub {
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

/* ============================================
   HOMEPAGE — HERO
   ============================================ */
.hero {
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 80px;
}

/* Wireframe animation canvas */
.hero__canvas {
  width: 100%;
  flex-shrink: 0;
  line-height: 0;
}

#wf-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.wf {
  fill: none;
  stroke: #5C5650;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.wf-thin  { stroke-width: 0.9; }
.wf-mid   { stroke-width: 1.15; }
.wf-outer { stroke-width: 1.35; }
.wf-arrow { fill: #5C5650; opacity: 0; }

.hero__container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero__eyebrow {
  margin-bottom: 8px;
}

.hero__name {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.1em;
}

.hero__title {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 640px;
}

.hero__tags {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.hero__scroll-indicator {
  margin-top: 48px;
  font-size: 18px;
  color: var(--color-text-muted);
  width: fit-content;
}

/* ============================================
   HOMEPAGE — SECTIONS
   ============================================ */
.section-work,
.section-about,
.section-contact {
  padding: var(--space-section) 0;
  border-top: 1px solid var(--color-border);
}

.about-teaser__text {
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.about-teaser__link {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text);
  transition: opacity 200ms ease;
}

.about-teaser__link:hover { opacity: 0.6; }

.contact-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .contact-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.contact-cta__text {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.contact-cta__link {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity 200ms ease;
}

.contact-cta__link:hover { opacity: 0.6; }

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-page__skills-heading {
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 40px 0 16px;
}

.about-page__skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.about-page__skills-list li {
  font-size: var(--text-small);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 12px;
  color: var(--color-text-muted);
}

.about-page__skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 48px;
  margin-top: 24px;
}

@media (min-width: 560px) {
  .about-page__skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-page__skill-title {
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: 4px;
}

.about-page__skill-sub {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.about-page__links {
  display: flex;
  gap: 24px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.about-page__links a {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text);
  transition: opacity 200ms ease;
}

.about-page__links a:hover { opacity: 0.6; }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-page__links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-page__email {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 300;
  color: var(--color-text);
  transition: opacity 200ms ease;
}

.contact-page__email:hover { opacity: 0.6; }

.contact-page__linkedin {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  transition: color 200ms ease;
}

.contact-page__linkedin:hover { color: var(--color-text); }

/* ============================================
   PAGE LOAD FADE
   ============================================ */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
