:root {
  --ink: #0B0F14;
  --ink-soft: #171C22;
  --paper: #FFFFFF;
  --surface: #F3F5F7;
  --line: #E3E7EA;
  --muted: #5C656E;
  --accent: #B08D57;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.top { position: absolute; inset: 0 0 auto 0; z-index: 10; color: var(--paper); }
.top-inner { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.mark img { display: block; width: 52px; height: 52px; border-radius: 8px; }
.wordmark {
  font-family: Bahnschrift, "DIN Alternate", "DIN Next", "Arial Narrow", var(--sans);
  font-size: 22px; font-weight: 400; letter-spacing: 0.04em; line-height: 1; color: var(--paper);
}
.wordmark b { font-weight: inherit; color: #E3061B; }
.top nav a, .foot nav a { text-decoration: none; font-size: 14px; letter-spacing: 0.06em; margin-left: 28px; opacity: .85; }
.top nav a:hover, .foot nav a:hover { opacity: 1; }

/* Hero */
.hero { background: var(--ink); color: var(--paper); padding: 200px 0 140px; }
.eyebrow { font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin: 0 0 24px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5.4vw, 64px); line-height: 1.12;
  margin: 0 0 32px; max-width: 16em;
}
.lead { font-size: 19px; color: #B9C0C7; max-width: 36em; margin: 0; }

/* Projects */
.projects { padding: 120px 0; }
.section-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 48px;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); background: var(--paper);
  padding: 36px 32px; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.card:hover { border-color: var(--ink); background: var(--surface); }
.media { margin: -36px -32px 32px; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ink); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .media img { transform: scale(1.04); }
.media-portrait img { object-position: 50% 0%; transform-origin: 50% 0; }
.media:not(.media-portrait):not(.media-logo) img { object-position: 36% 50%; }
.media-logo { display: grid; place-items: center; background: var(--ink-soft); }
.media-logo img { width: 92%; height: auto; object-fit: contain; }
.num { font-family: var(--serif); color: var(--accent); font-size: 18px; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 20px 0 4px; }
.tag { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 20px; }
.card p:not(.tag) { margin: 0 0 32px; color: #2A3139; flex: 1; }
.link { font-size: 15px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 18px; }
.link i { font-style: normal; display: inline-block; transition: transform .2s; }
.card:hover .link i { transform: translateX(4px); }

/* Contact */
.contact { background: var(--surface); padding: 110px 0; }
.contact-inner .section-title { margin-bottom: 24px; }
.big { font-family: var(--serif); font-size: clamp(22px, 3.4vw, 36px); margin: 0 0 12px; word-break: break-word; }
.big a { text-decoration: none; border-bottom: 1px solid var(--accent); }
.muted { color: var(--muted); margin: 0; }

/* Footer */
.foot { background: var(--ink-soft); color: #9AA3AB; font-size: 14px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; min-height: 72px; flex-wrap: wrap; gap: 12px; }
.foot nav a { margin: 0 0 0 24px; }

/* Legal pages */
.legal { padding: 140px 0 100px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; margin: 0 0 40px; }
.legal h2 { font-size: 18px; margin: 40px 0 8px; }
.legal .top { color: var(--ink); }
.back { font-size: 14px; }
.legal-nav { display: flex; justify-content: space-between; font-size: 14px; }
.top nav a.lang { border: 1px solid currentColor; padding: 3px 8px; font-size: 12px; letter-spacing: 0.12em; }

/* Cookie consent */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  max-width: 560px; margin-left: auto;
  background: var(--ink-soft); color: #D5DADF; border: 1px solid #2A3139;
  padding: 20px 22px; font-size: 14px; line-height: 1.55;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 14px; }
.consent a { color: var(--paper); }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent button {
  font: inherit; font-size: 13px; letter-spacing: 0.06em; cursor: pointer;
  padding: 9px 18px; background: transparent; color: var(--paper); border: 1px solid #5C656E;
}
.consent button.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.consent button:hover { border-color: var(--paper); }
.consent button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion: pure CSS, no library */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* Hero plays once on load, staggered */
  .hero .eyebrow, .hero h1, .hero .lead { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero h1 { animation-delay: .12s; }
  .hero .lead { animation-delay: .28s; }

  /* Sections below reveal as they scroll into view (browsers without
     scroll-driven animations simply show them static) */
  @supports (animation-timeline: view()) {
    .section-title, .card, .contact-inner > div {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    .card:nth-child(2) { animation-range: entry 8% entry 68%; }
    .card:nth-child(3) { animation-range: entry 16% entry 76%; }
  }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 150px 0 96px; }
  .projects, .contact { padding: 80px 0; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .wordmark { font-size: 14px; }
  .top nav a { margin-left: 18px; }
  .foot nav a { margin: 0 20px 0 0; }
}
@media (max-width: 520px) {
  .mark img { width: 36px; height: 36px; border-radius: 5px; }
}
@media (max-width: 600px) {
  /* Phones: keep logo and language switch, drop the in-page links */
  .top nav a:not(.lang) { display: none; }
}
@media (min-width: 601px) and (max-width: 900px) {
  /* Tablet: cards lie flat, image left, text right */
  .card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 32px; align-content: start; padding: 0 32px 0 0; }
  .card > :not(.media) { grid-column: 2; }
  .media { grid-column: 1; grid-row: 1 / span 6; margin: 0; aspect-ratio: auto; height: 100%; min-height: 320px; }
  .num { margin-top: 32px; }
  .card h3 { margin-top: 12px; }
  .card p:not(.tag) { margin-bottom: 24px; }
  .link { margin-bottom: 32px; align-self: end; }
}
@media (max-width: 600px) {
  /* Phones: wide images stay wide, the portrait keeps its square so hair and pocket square show */
  .media:not(.media-portrait) { aspect-ratio: 16 / 10; }
  .media-logo img { width: 70%; }
  .card { padding: 28px 24px; }
  .media { margin: -28px -24px 28px; }
}
