/* DAFRI — minimalist architecture studio
   Palette: white, warm beige, charcoal, black */

:root {
  --white: #ffffff;
  --paper: #faf8f4;
  --beige: #efe8dc;
  --sand: #d8cbb6;
  --stone: #8a8174;
  --charcoal: #2b2a28;
  --black: #111110;

  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(5rem, 12vw, 10rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, .95rem + .2vw, 1.075rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; }
ul[role="list"], ol { list-style: none; margin: 0; padding: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--black); color: var(--white);
  padding: .75rem 1.25rem; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }

/* Typography helpers */
.eyebrow {
  display: inline-flex; align-items: center; gap: .9rem;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 500;
  color: var(--stone); margin-bottom: 1.75rem;
}
.eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; opacity: .6; }
.eyebrow .num { font-variant-numeric: tabular-nums; color: var(--charcoal); }
.eyebrow--light, .eyebrow--light .num { color: rgba(255,255,255,.85); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4.25rem);
  line-height: 1.05; letter-spacing: -.01em; color: var(--black);
}
.section-title em, .hero-title em, .contact-title em { font-style: italic; }

.section-lede { max-width: 36rem; color: var(--stone); margin-top: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: 1.05rem 1.9rem; border: 1px solid currentColor;
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  text-decoration: none; transition: background .35s var(--ease), color .35s var(--ease), gap .35s var(--ease);
}
.btn:hover { gap: 1.4rem; }
.btn--light { color: var(--white); }
.btn--light:hover { background: var(--white); color: var(--black); }
.btn--dark { color: var(--black); }
.btn--dark:hover { background: var(--black); color: var(--white); }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: var(--white);
  transition: background .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.is-solid {
  background: rgba(250, 248, 244, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--charcoal); box-shadow: 0 1px 0 rgba(17,17,16,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 5rem; }

.logo {
  font-family: var(--sans); font-weight: 600; font-size: 1.05rem;
  letter-spacing: .42em; text-decoration: none; margin-right: -.42em;
}
.logo--small { font-size: .9rem; }

.site-nav ul { display: flex; gap: clamp(1.5rem, 3vw, 3rem); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  position: relative; text-decoration: none;
  font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
  padding-block: .5rem;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none; position: relative; z-index: 60;
  width: 2.75rem; height: 2.75rem; padding: 0; margin-right: -.6rem;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.nav-toggle-bar {
  position: absolute; left: .6rem; right: .6rem; height: 1px; background: currentColor;
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.nav-toggle-bar:nth-of-type(2) { top: 1.1rem; }
.nav-toggle-bar:nth-of-type(3) { top: 1.6rem; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(2) { top: 1.35rem; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(3) { top: 1.35rem; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 0; background: var(--paper); color: var(--black);
    display: flex; align-items: center; padding: var(--gutter);
    opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 1.25rem; }
  .site-nav a {
    font-family: var(--serif); font-size: 2.5rem; letter-spacing: 0; text-transform: none;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .site-header { color: var(--black); }
}

/* Hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end; color: var(--white); overflow: hidden;
  background: var(--charcoal);
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: hero-in 2.4s var(--ease) both;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(17,17,16,.35) 0%, rgba(17,17,16,0) 30%, rgba(17,17,16,.15) 55%, rgba(17,17,16,.7) 100%);
}
.hero-content { position: relative; padding-block: 8rem clamp(2.5rem, 6vw, 5rem); }
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 1.5rem + 8.5vw, 10rem);
  line-height: .92; letter-spacing: -.02em;
  animation: rise 1.4s .2s var(--ease) both;
}
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 2rem; margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.35);
  animation: rise 1.4s .45s var(--ease) both;
}
.hero-intro { max-width: 30rem; color: rgba(255,255,255,.9); font-weight: 300; font-size: 1.05rem; }

@keyframes hero-in { from { transform: scale(1.08); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Sections */
.section { padding-block: var(--section); }
.section-head { margin-bottom: clamp(3rem, 7vw, 6rem); max-width: 52rem; }
.section-head--split {
  max-width: none; display: grid; gap: 1.5rem; align-items: end;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.2fr 1fr; }
  .section-head--split .section-lede { margin-top: 0; justify-self: end; }
}

/* Projects */
.project-grid {
  display: grid; gap: clamp(3.5rem, 7vw, 6rem) clamp(1.5rem, 3vw, 2.75rem);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project--wide { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .project-grid { grid-template-columns: repeat(12, 1fr); }
  .project { grid-column: span 4; }
  .project--wide { grid-column: 1 / span 7; }
  .project--offset { grid-column: 9 / span 4; align-self: end; }
  .project--wide.project--reverse { grid-column: 6 / span 7; }
  .project--wide .project-media { aspect-ratio: 4 / 3; }
}

.project article { display: flex; flex-direction: column; gap: 1.5rem; }
.project-media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--beige); }
.project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.project article:hover .project-media img { transform: scale(1.04); }

.badge {
  position: absolute; top: 1rem; left: 1rem;
  padding: .4rem .7rem; background: rgba(250,248,244,.92); color: var(--charcoal);
  font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
}

.project-meta {
  display: flex; flex-wrap: wrap; gap: .35rem 1.25rem;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--stone);
}
.project-meta span:first-child { color: var(--charcoal); font-weight: 600; }
.project-title {
  font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  line-height: 1.15; color: var(--black); margin-top: .6rem;
}
.project-title .ph { font-family: var(--sans); font-size: .75rem; letter-spacing: .05em; color: var(--stone); white-space: nowrap; }
.project-desc { color: var(--stone); margin-top: .6rem; max-width: 34rem; }

/* About */
.about { background: var(--beige); }
.about-grid { display: grid; gap: clamp(3rem, 7vw, 7rem); align-items: center; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.15fr .85fr; } }
.about-text .lead {
  font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + .8vw, 1.8rem);
  line-height: 1.4; color: var(--black); margin: 2rem 0 1.25rem; max-width: 36rem;
}
.about-text > p:not(.lead):not(.eyebrow) { max-width: 36rem; }
.principles {
  display: grid; gap: 2rem; margin-top: 3.5rem; padding-top: 2.5rem;
  border-top: 1px solid rgba(43,42,40,.18);
}
@media (min-width: 600px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles h3 { font-family: var(--serif); font-size: 1.6rem; color: var(--black); margin-bottom: .5rem; }
.principles p { font-size: .92rem; color: var(--stone); }
.about-media { aspect-ratio: 4 / 5; overflow: hidden; }
.about-media img { width: 100%; height: 100%; object-fit: cover; }

/* Services */
.services { background: var(--black); color: rgba(255,255,255,.72); }
.services .section-title { color: var(--white); }
.services .section-lede { color: rgba(255,255,255,.6); }
.service-list { display: grid; border-top: 1px solid rgba(255,255,255,.16); }
@media (min-width: 760px) { .service-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .service-list { grid-template-columns: repeat(4, 1fr); } }
.service {
  padding: 2.5rem 0; border-bottom: 1px solid rgba(255,255,255,.16);
  display: flex; flex-direction: column; gap: 1rem;
  transition: background .4s var(--ease);
}
@media (min-width: 760px) {
  .service { padding: 3rem 2rem 3.5rem; border-right: 1px solid rgba(255,255,255,.16); }
  .service:nth-child(2n) { border-right: 0; }
  .service:hover { background: rgba(255,255,255,.03); }
}
@media (min-width: 1100px) {
  .service { min-height: 22rem; }
  .service:nth-child(2n) { border-right: 1px solid rgba(255,255,255,.16); }
  .service:last-child { border-right: 0; }
}
.service-num { font-size: .75rem; letter-spacing: .2em; color: var(--sand); }
.service h3 { font-family: var(--serif); font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem); color: var(--white); line-height: 1.1; margin-top: auto; }
@media (max-width: 759px) { .service h3 { margin-top: 0; } }
.service p { font-size: .95rem; max-width: 22rem; }

/* Contact */
.contact { background: var(--white); text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-title {
  font-family: var(--serif); color: var(--black);
  font-size: clamp(2.6rem, 1.5rem + 5vw, 6rem); line-height: 1; letter-spacing: -.015em;
}
.contact-text { color: var(--stone); margin: 1.75rem 0 3rem; max-width: 30rem; }
.contact-email {
  font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 3vw, 3.25rem);
  color: var(--black); text-decoration: none; margin-bottom: 3rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: .2rem; transition: background-size .5s var(--ease);
  overflow-wrap: anywhere;
}
.contact-email:hover { background-size: 0 1px; background-position: 100% 100%; }

/* Footer */
.site-footer { background: var(--paper); border-top: 1px solid rgba(17,17,16,.08); padding-block: 2.5rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  font-size: .8rem; color: var(--stone);
}
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--black); }

/* Reveal on scroll (only when JS is available) */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* 404 */
.notfound {
  min-height: 100vh; min-height: 100svh; display: grid; place-content: center; text-align: center; gap: 1.5rem;
  padding: var(--gutter);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
