/* Dé Crafterz website
   Grounds: brass (the logo's copper), white for the gallery, teak for the studio and footer.
   Every colour comes from the ground a block sits on. */

@font-face { font-family: "Gilda Display"; src: url("../fonts/gilda-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --brass: #c98f4f;          /* the logo copper, used as a ground */
  --teak: #22160e;           /* deep timber */
  --teak-2: #2b1d14;
  --paper: #ffffff;
  --cream-on-teak: #f6eadb;

  --display: "Gilda Display", "Iowan Old Style", Georgia, serif;
  --text: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --row-gap: clamp(12px, 1.4vw, 20px);
  --header-h: 72px;
}

/* grounds set the local palette */
.ground-brass {
  --ground: var(--brass);
  --ink: var(--teak);
  --ink-soft: #3b2819;
  --link: var(--teak);
  --line: var(--teak);          /* rules, compare line */
  --sketch: #fff8ee;            /* hero sketch lines */
  --btn-bg: var(--teak);
  --btn-ink: var(--cream-on-teak);
  --hairline: rgba(34, 22, 14, 0.28);
  --focus: var(--teak);
  background: var(--ground);
  color: var(--ink);
}
.ground-paper {
  --ground: var(--paper);
  --ink: var(--teak-2);
  --ink-soft: #66574b;
  --link: #8a5a2b;
  --line: var(--brass);
  --btn-bg: var(--teak-2);
  --btn-ink: #ffffff;
  --hairline: rgba(43, 29, 20, 0.14);
  --focus: #8a5a2b;
  background: var(--ground);
  color: var(--ink);
}
.ground-teak {
  --ground: var(--teak-2);
  --ink: var(--cream-on-teak);
  --ink-soft: #c9bcae;
  --link: #e7b67f;
  --line: var(--brass);
  --btn-bg: var(--cream-on-teak);
  --btn-ink: var(--teak-2);
  --hairline: rgba(246, 234, 219, 0.16);
  --focus: #e7b67f;
  background: var(--ground);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--teak-2);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus, var(--teak)); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 50; background: var(--teak); color: var(--cream-on-teak); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { top: 12px; color: var(--cream-on-teak); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.75rem, 6.6vw, 5.75rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.08; }
h3 { font-size: clamp(1.625rem, 2.4vw, 2.125rem); line-height: 1.15; }
p { margin: 0; max-width: 62ch; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink);
  font: 500 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.button:hover { background: color-mix(in srgb, var(--btn-bg) 84%, #000); color: var(--btn-ink); }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.button--quiet:hover { background: var(--ink); color: var(--ground); }
.button svg { width: 20px; height: 20px; flex: none; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; transition: border-color 200ms ease; }
.site-header.is-scrolled { border-bottom-color: var(--hairline); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.site-header__logo { display: flex; align-items: center; gap: clamp(10px, 1.1vw, 14px); color: var(--ink); text-decoration: none; }
.site-header__logo svg { width: clamp(132px, 14vw, 180px); height: auto; }
.site-header__mark { height: clamp(34px, 3.1vw, 46px); width: auto; flex: none; }
.site-header__logo .ink { fill: currentColor; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.site-nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.975rem; }
.site-nav a:not(.button):hover { text-decoration: underline; }
.site-nav .button { min-height: 42px; padding: 0 20px; font-size: 0.95rem; }
@media (max-width: 760px) { .site-nav a:not(.button) { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(28px, 5vw, 64px) clamp(48px, 7vw, 88px); }
.hero__intro {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(20px, 4vw, 64px); align-items: end; margin-bottom: clamp(24px, 4vw, 48px);
}
.hero__lede { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 860px) { .hero__intro { grid-template-columns: 1fr; align-items: start; } }

/* the one moving idea: the sketch on one side, the finished room on the other */
.compare {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  border-top-left-radius: 18.7% 28%;
  background: var(--ground);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
  --pos: 56%;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare__sketch { position: absolute; inset: 0; background: var(--ground); clip-path: inset(0 calc(100% - var(--pos)) 0 0); pointer-events: none; }
.compare__sketch::after {
  content: ""; position: absolute; inset: 0; background: var(--sketch);
  -webkit-mask: url("../img/hero-lines-1280.webp") center / cover no-repeat;
  mask: url("../img/hero-lines-1280.webp") center / cover no-repeat;
}
.compare__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--line); pointer-events: none; }
.compare__knob {
  position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: var(--line); color: var(--ground);
  display: grid; place-items: center;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--line) 22%, transparent);
}
.compare__knob svg { width: 26px; height: 26px; }
.compare:focus-within .compare__knob { outline: 2px solid var(--ink); outline-offset: 4px; }
.compare__hint { margin-top: 14px; font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- statement (still on brass, closes the opening) ---------- */
.statement { padding-block: 0 clamp(72px, 10vw, 136px); }
.statement__text { font-family: var(--display); font-size: clamp(2rem, 4.6vw, 3.75rem); line-height: 1.12; max-width: 22ch; }

/* ---------- work ---------- */
.work { padding-block: clamp(64px, 9vw, 120px) clamp(72px, 10vw, 140px); }
.work__title { margin-bottom: clamp(32px, 5vw, 64px); }
.room-group {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--row-gap) clamp(20px, 3vw, 48px);
  padding-block: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--hairline);
}
.room-group__title { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.room-group__rows { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.room-row { display: flex; gap: var(--row-gap); align-items: flex-start; }
.room { flex: var(--ar) 1 0; min-width: 0; margin: 0; }
.room__open { display: block; padding: 0; border: 0; background: none; width: 100%; cursor: zoom-in; color: inherit; }
.room img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; background: #f1eee9; }
.room--portrait img { border-radius: 50% 50% 0 0 / 37.5% 37.5% 0 0; }
.room--landscape img { border-top-left-radius: 18.7% 28%; }
.room-row > .room--landscape:last-child:not(:first-child) img { border-top-left-radius: 0; border-top-right-radius: 18.7% 28%; }
.room figcaption { margin-top: 10px; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-soft); max-width: 44ch; }
@media (max-width: 860px) { .room-group { grid-template-columns: 1fr; } .room-group__title { position: static; } }
@media (max-width: 560px) {
  .room-row { flex-wrap: wrap; }
  .room--landscape { flex: 1 1 100%; }
  .room--portrait { flex: 1 1 calc(50% - var(--row-gap) / 2); }
  .room--portrait:last-child:nth-child(odd) { flex-basis: 100%; }
}

/* ---------- villa walkthrough ---------- */
.villa { padding-block: clamp(64px, 9vw, 128px); }
.villa__inner { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.villa__text p { margin-top: 20px; color: var(--ink-soft); font-size: 1.125rem; }
.villa__frame { position: relative; width: min(100%, 420px); justify-self: center; }
.villa__frame video { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 50% 50% 0 0 / 28.125% 28.125% 0 0; background: var(--teak); }
.villa__toggle { position: absolute; right: 14px; bottom: 14px; min-height: 40px; padding: 0 16px; font-size: 0.875rem; }
@media (max-width: 860px) { .villa__inner { grid-template-columns: 1fr; } }

/* ---------- practice ---------- */
.practice { padding-block: clamp(72px, 10vw, 140px); }
.practice__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(36px, 7vw, 112px); align-items: center; }
.portrait { position: relative; margin: 0; width: min(100%, 420px); justify-self: center; }
.portrait img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 50% 50% 0 0 / 37.5% 37.5% 0 0; background: var(--paper); }
/* a brass line drawn around the photo, like a sketch outline */
.portrait::before {
  content: ""; position: absolute; inset: -14px 14px 14px -14px;
  border: 1px solid var(--brass); border-bottom: 0;
  border-radius: 50% 50% 0 0 / 37.5% 37.5% 0 0; pointer-events: none;
}
.practice__text p { margin-top: 22px; font-size: 1.1875rem; line-height: 1.65; color: var(--ink-soft); }
.practice__mark { width: 132px; margin-top: 40px; }
@media (max-width: 860px) { .practice__inner { grid-template-columns: 1fr; } .portrait { width: min(78%, 360px); } }

/* ---------- process ---------- */
.process { padding-block: clamp(72px, 10vw, 140px); }
.process__title { max-width: 18ch; }
.steps { list-style: none; margin: clamp(36px, 5vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); position: relative; }
.steps::before { content: ""; position: absolute; top: 32px; left: 32px; right: 12%; height: 1px; background: var(--line); }
.step { position: relative; }
.step__icon { display: block; width: 64px; height: 64px; color: var(--brass); background: var(--ground); margin-bottom: 22px; position: relative; }
.step__icon svg { width: 64px; height: 64px; }
.step h3 { font-size: clamp(1.5rem, 2vw, 1.875rem); }
.step p { margin-top: 10px; color: var(--ink-soft); max-width: 30ch; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps::before { top: 0; bottom: 0; left: 31px; right: auto; width: 1px; height: auto; }
  .step { display: grid; grid-template-columns: 64px 1fr; column-gap: 20px; }
  .step__icon { margin-bottom: 0; grid-row: span 2; }
  .step p { margin-top: 6px; }
}

/* ---------- enquiry ---------- */
.enquire { padding-block: clamp(72px, 10vw, 140px); }
.enquire__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); }
.enquire__intro p { margin-top: 20px; color: var(--ink-soft); font-size: 1.125rem; }
.enquire__contact { margin-top: 28px; display: grid; gap: 12px; justify-items: start; }
.enquire__contact a { font-weight: 500; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.field { display: grid; gap: 8px; }
.field--wide { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 500; font-size: 0.975rem; padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid rgba(34, 22, 14, 0.32); border-radius: 10px;
  background: #fffaf3; color: var(--teak); font: 400 1rem/1.4 var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: #7b6a5c; }
.field textarea { min-height: 112px; resize: vertical; }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%2322160e' stroke-width='1.5' d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teak); outline-offset: 1px; border-color: transparent; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(34, 22, 14, 0.32); background: #fffaf3; color: var(--teak); cursor: pointer; font-size: 0.975rem;
}
.chip input:checked + span { background: var(--teak); border-color: var(--teak); color: var(--cream-on-teak); }
.chip input:focus-visible + span { outline: 2px solid var(--teak); outline-offset: 2px; }
.form__error { color: var(--ink); font-weight: 500; font-size: 0.95rem; min-height: 1.4em; }
.form__note { font-size: 0.9rem; color: var(--ink-soft); }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
@media (max-width: 860px) { .enquire__inner { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { padding-block: clamp(56px, 8vw, 96px) 40px; font-size: 0.975rem; color: var(--ink-soft); }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--brass); }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 3fr)); gap: 40px; }
.site-footer__lockup { width: min(100%, 360px); }
.site-footer h2 { font-family: var(--text); font-weight: 500; font-size: 1rem; color: var(--ink); margin-bottom: 10px; }
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__legal { max-width: none; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline); font-size: 0.875rem; }
@media (max-width: 860px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- photo viewer ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(28, 18, 11, 0.95); color: var(--cream-on-teak); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: rgba(28, 18, 11, 0.95); }
.lightbox__stage { display: grid; place-items: center; padding: 64px 72px 16px; min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; object-fit: contain; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px) 24px; }
.lightbox__caption { color: #c9bcae; max-width: 60ch; }
.lightbox__nav { display: flex; gap: 10px; }
.lightbox__btn { min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(246, 234, 219, 0.4); background: transparent; color: var(--cream-on-teak); font: 500 0.95rem/1 var(--text); cursor: pointer; }
.lightbox__btn:hover { background: rgba(246, 234, 219, 0.12); }
.lightbox__close { position: absolute; top: 16px; right: 16px; }
@media (max-width: 560px) { .lightbox__stage { padding: 64px 12px 12px; } }

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