/* ==========================================================
   Necto Design — style.css
   Layout after doughsound.fi, monochrome Necto palette.
   Plain CSS, no build step. Colours are set once below.
   ========================================================== */

/* ---------- Fonts (self-hosted, no Google requests — GDPR friendly) ---------- */
@font-face { font-family: "Fustat"; src: url("../fonts/fustat-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fustat"; src: url("../fonts/fustat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Fustat"; src: url("../fonts/fustat-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fustat"; src: url("../fonts/fustat-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Section colours (change here to re-theme the whole site) */
  /* Scandinavian light palette: snow, birch, sand, pine, slate */
  --c-hero: #ede8df;      /* hero + page heads (birch) */
  --c-hero-ink: #23272a;
  --c-work: #f7f5f1;      /* projects section (snow) */
  --c-about: #e4ddd1;     /* studio + services (sand) */
  --c-page: #f7f5f1;      /* sub-page background */
  --c-foot: #3e4a44;      /* footer (muted pine) */
  --c-foot-ink: #eef0ea;
  --l-birch: #cfc3b0;
  --ink: #23272a;
  --ink-2: #545a5c;
  --ink-3: #8b8f8c;
  --line: rgba(35, 39, 42, .25);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Fustat", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 2vw, 32px);
  --radius: 16px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--c-page); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.4; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-align: inherit; }
::selection { background: var(--ink); color: var(--c-page); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.wrap { width: 100%; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
.serif { font-family: var(--serif); font-weight: 400; }
.h-sentence {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(42px, 5.6vw, 92px); line-height: 1.04; letter-spacing: -.02em; margin: 0;
}
.h-section { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 2.8vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 22px; }
.label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; margin: 0 0 22px; }
.text-link { display: inline-block; font-size: 16px; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 1px; transition: opacity .3s; }
.text-link:hover { opacity: .6; }
.lead-bold { font-weight: 700; font-size: 19px; line-height: 1.3; margin: 0 0 18px; max-width: 46ch; }
.prose p { margin: 0 0 18px; max-width: 52ch; }

/* ---------- Header (white, difference-blended so it reads on any colour) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); color: #fff; mix-blend-mode: difference; pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.logo { font-family: var(--sans); font-weight: 800; font-size: 30px; letter-spacing: -.045em; line-height: 1; text-transform: uppercase; }
.logo img { height: 30px; width: auto; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 16px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.nav .lang { opacity: .7; margin-left: 10px; font-size: 14px; letter-spacing: .04em; }
.menu-btn { display: none; font-size: 16px; font-weight: 500; }

/* Mobile menu (separate layer, not blended) */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60; background: var(--c-hero); color: var(--c-hero-ink);
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px var(--gutter) 32px;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
}
.mobile-menu .top { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu nav { display: grid; gap: 6px; font-family: var(--serif); font-size: 52px; line-height: 1.05; }
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.menu-open { overflow: hidden; }
@media (max-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: inline-block; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--c-hero); color: var(--c-hero-ink);
  min-height: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  padding: calc(var(--header-h) + 48px) var(--gutter) 72px; gap: 24px; overflow: hidden;
}
.hero-sub { margin: 26px 0 0; font-size: 18px; max-width: 40ch; opacity: .8; }
.hero .text-link { margin-top: 18px; }
/* Headline lines: fade in word by word, then swap */
.hero-lines { display: grid; }
.hero-lines .hl { grid-area: 1 / 1; align-self: end; visibility: hidden; }
.hero-lines .hl.is-active, .hero-lines .hl.is-leaving { visibility: visible; }
.hero-lines .w { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px);
  transition: opacity .9s var(--ease), transform 1s var(--ease), filter .9s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.hero-lines .hl.is-active .w { opacity: 1; transform: none; filter: none; }
.hero-lines .hl.is-leaving .w { opacity: 0; transform: translateY(-.2em); filter: blur(6px); transition-duration: .6s; transition-delay: calc(var(--i) * 30ms); }
.hero-sub, .hero .text-link { animation: fadeUp 1.2s var(--ease) .6s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Texture panel (arch) with slow crossfade */
.texture { position: relative; justify-self: end; width: min(100%, 520px); aspect-ratio: 4 / 5; max-height: 74svh;
  border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; background: var(--l-birch);
  animation: fadeUp 1.4s var(--ease) .2s both; }
.texture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: scale(1.04); transition: opacity 1.6s var(--ease), transform 7s linear; }
.texture img.is-active { opacity: 1; transform: scale(1); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; align-content: end; padding-bottom: 36px; }
  .hero .texture { order: -1; justify-self: stretch; width: 100%; aspect-ratio: 4 / 3.4; max-height: 52svh; }
}

/* Hero photo below the headline */
.hero-photo { background: linear-gradient(var(--c-hero) 55%, var(--c-work) 55%); padding: 0 var(--gutter); }
.hero-photo figure { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; background: var(--l-birch); }
.hero-photo img { width: 100%; height: 115%; object-fit: cover; will-change: transform; }
@media (max-width: 760px) { .hero-photo figure { aspect-ratio: 4 / 3; } }

/* ---------- Work grid ---------- */
.work { background: var(--c-work); padding: 56px 0 72px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px var(--gutter); }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.card { display: block; }
.card__img { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: #cfccc6; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.card:hover .card__img img { transform: scale(1.035); }
.card__cap { margin-top: 8px; font-size: 16px; }
.card__cap b { font-weight: 700; }
.card[hidden] { display: none; }
.pill { display: inline-block; margin-top: 36px; border: 1px solid currentColor; border-radius: 12px; padding: 10px 26px; font-size: 16px; font-weight: 500; text-align: center; transition: background .3s, color .3s; }
.pill:hover { background: var(--ink); color: var(--c-work); border-color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filters button { border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px; font-size: 15px; font-weight: 500; transition: all .3s; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--c-page); border-color: var(--ink); }

.more-head { margin: 88px 0 24px; font-size: clamp(26px, 2.2vw, 34px); }
.grid--three { grid-template-columns: repeat(3, 1fr); gap: 32px var(--gutter); }
.grid--three .card__img { aspect-ratio: 4 / 3; }
@media (max-width: 1024px) { .grid--three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid--three { grid-template-columns: 1fr; } }
.grid--small { grid-template-columns: repeat(5, 1fr); gap: 22px var(--gutter); }
.grid--small .card__img { aspect-ratio: 4 / 3; }
.grid--small .card__cap { font-size: 14px; }
@media (max-width: 1100px) { .grid--small { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .grid--small { grid-template-columns: repeat(2, 1fr); } }
.more-head[hidden], .grid--small:empty { display: none; }

/* ---------- About ---------- */
.about { background: var(--c-about); padding: 56px 0 0; }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px var(--gutter); align-items: start; }
.about__photo { border-radius: var(--radius); overflow: hidden; background: #c4bfb5; }
.about__photo img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; }
.signature { margin-top: 6px; }
.facts-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.facts-row span { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.big-num { font-family: var(--serif); font-size: clamp(64px, 7vw, 110px); line-height: .9; letter-spacing: -.03em; margin-top: 36px; }
.big-num small { font-family: var(--sans); font-size: 15px; letter-spacing: 0; display: block; margin-top: 8px; color: var(--ink-2); }
@media (max-width: 760px) { .about__grid { grid-template-columns: 1fr; } .about__photo { order: -1; } }

.about-statement { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 56px); line-height: 1.1; letter-spacing: -.02em; max-width: 32ch; margin: 0 0 64px; }

/* ---------- Services accordion ---------- */
.services { background: var(--c-about); padding: 72px 0 96px; }
.services .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
@media (max-width: 760px) { .services .wrap { grid-template-columns: 1fr; } }
.acc { border-top: 1px solid var(--ink); }
.acc__item { border-bottom: 1px solid var(--ink); }
.acc__btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-family: var(--serif); font-size: clamp(28px, 2.6vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
.acc__icon { font-family: var(--sans); font-size: 22px; font-weight: 300; transition: transform .35s var(--ease); flex: none; }
.acc__btn[aria-expanded="true"] .acc__icon { transform: rotate(45deg); }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.acc__panel > div { overflow: hidden; }
.acc__panel p { margin: 0 0 22px; max-width: 48ch; color: var(--ink-2); }
.acc__panel ul { margin: -8px 0 24px; padding-left: 18px; color: var(--ink-2); font-size: 16px; }
.acc__btn[aria-expanded="true"] + .acc__panel { grid-template-rows: 1fr; }

/* ---------- Contact ---------- */
.contact { background: var(--c-work); padding: 72px 0 96px; }
.contact .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px var(--gutter); }
@media (max-width: 760px) { .contact .wrap { grid-template-columns: 1fr; } }
.form { display: grid; gap: 22px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 520px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; margin-bottom: 4px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); padding: 8px 0 10px; border-radius: 0;
}
.field select { appearance: none; -webkit-appearance: none; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-bottom-width: 2px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.consent { font-size: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.consent input { margin-top: 3px; accent-color: var(--ink); }
.btn { justify-self: start; border: 1px solid var(--ink); border-radius: 12px; padding: 12px 30px; font-size: 16px; font-weight: 500; transition: background .3s, color .3s; }
.btn:hover { background: var(--ink); color: var(--c-work); }
.btn[disabled] { opacity: .5; cursor: wait; }
.form-status { font-size: 15px; min-height: 1.4em; margin: 0; }
.form-status.ok { color: #1f6b3a; } .form-status.err { color: #a12a1f; }
.form-status a { text-decoration: underline; }

/* ---------- Sub pages ---------- */
.page-head { background: var(--c-hero); color: var(--c-hero-ink); padding: calc(var(--header-h) + 80px) 0 64px; }
.page-head p { max-width: 50ch; margin: 24px 0 0; font-size: 19px; opacity: .85; }
.section { padding: 56px 0 88px; }

/* Project detail */
.project-head { background: var(--c-hero); color: var(--c-hero-ink); padding: calc(var(--header-h) + 72px) 0 0; }
.project-head .h-sentence { max-width: 16ch; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px var(--gutter); border-top: 1px solid var(--line); margin: 40px 0 0; padding: 18px 0 40px; }
.facts dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.facts dd { margin: 4px 0 0; font-size: 17px; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.project-cover { display: flex; justify-content: center; }
/* natural size and ratio: never cropped, never enlarged beyond the file's own pixels */
.project-cover img { width: auto; height: auto; max-width: 100%; max-height: 86vh; border-radius: var(--radius); }
.split-band { background: linear-gradient(var(--c-hero) 50%, var(--c-page) 50%); padding: 0 var(--gutter); }
.project-text { display: grid; grid-template-columns: 1fr 1fr; gap: 32px var(--gutter); padding: 64px 0 48px; }
.project-text .intro { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; letter-spacing: -.015em; margin: 0; }
@media (max-width: 760px) { .project-text { grid-template-columns: 1fr; } }
.gallery { columns: 2; column-gap: var(--gutter); }
.gallery figure { margin: 0 0 var(--gutter); break-inside: avoid; cursor: zoom-in; }
/* natural ratio, no cropping, no upscaling */
.gallery img { width: 100%; height: auto; border-radius: var(--radius); }
@media (max-width: 600px) { .gallery { columns: 1; } }
.next { display: block; background: var(--c-work); padding: 64px var(--gutter) 80px; margin-top: 72px; }
.next .h-sentence:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(12,12,11,.96); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; color: #fff; padding: 16px; font-size: 15px; }
.lb-close { top: 10px; right: 10px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 28px !important; }
.lb-prev { left: 6px; } .lb-next { right: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-foot); color: var(--c-foot-ink); padding: 40px var(--gutter) 24px; font-size: 16px; line-height: 1.35; }
.site-footer .cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px var(--gutter); }
.site-footer b { font-weight: 700; }
.site-footer a { border-bottom: 1px solid currentColor; }
.site-footer .socials { justify-self: end; display: grid; gap: 2px; align-content: start; }
.site-footer .bottom { border-top: 1px solid rgba(238,240,234,.2); padding-top: 18px; display: flex; justify-content: flex-end; margin-top: 110px; font-size: 13px; opacity: .8; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } .site-footer .socials { justify-self: start; } .site-footer .bottom { justify-content: flex-start; margin-top: 56px; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

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