/* ==========================================================
   MINISTRY OF INTERIOR DESIGN — site styles
   Colours, line weights and positions are taken from the
   uploaded portfolio PDF (1920 x 1080 layout, scaled with --s).
   ========================================================== */

:root {
  --black: #000000;
  --white: #ffffff;
  --cream: #ede9e4;      /* highlight 1 */
  --red:   #8e1a1c;      /* highlight 2 (the corner mark) */
  --line:  #404141;      /* grid line colour from the PDF */

  --s: 1;                                  /* scale of the frame: 1 = desktop */
  --lt:   max(1px, calc(1.94px * var(--s)));  /* single line thickness */
  --band: calc(88px * var(--s));           /* height of top / bottom bars */

  --pad-l: 132px;                          /* content starts right of the vertical lines */
  --pad-r: 56px;

  /* Century Gothic first; Questrial is the closest free look-alike for visitors who don't have it */
  --f-head: "Century Gothic", "CenturyGothic", "Questrial", "Avant Garde", sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-nav: 15px;
  --gap: 28px;
}

@media (max-width: 1100px) {
  :root { --s: 0.75; --pad-l: 104px; --pad-r: 32px; --fs-nav: 13px; --gap: 20px; }
}
@media (max-width: 700px) {
  :root { --s: 0.5; --pad-l: 64px; --pad-r: 18px; --fs-nav: 10.5px; --gap: 14px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }

/* ---------- The grid lines + corner mark (fixed on every page) ----------
   Built segment by segment from the PDF: double lines run along the top and
   bottom, but only ONE line continues past the logo and past the red mark. */
.frame { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.ln { position: absolute; background: var(--line); }
.mark {
  position: absolute;
  left: calc(70.26px * var(--s)); bottom: calc(70.24px * var(--s));
  width: calc(28.12px * var(--s)); height: calc(28.12px * var(--s));
}
.mark svg { display: block; width: 100%; height: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--band);
  background: var(--black); z-index: 20;
}
.logo {
  position: fixed; z-index: 40;
  left: calc(40.84px * var(--s)); top: calc(39.53px * var(--s));
  width: calc(86.95px * var(--s)); height: calc(86.95px * var(--s));
  display: block;
}
.logo svg { width: 100%; height: 100%; display: block; }

.nav {
  position: absolute; right: var(--pad-r); top: 0; height: calc(78.69px * var(--s));
  display: flex; align-items: center; gap: calc(40px * var(--s) + 6px);
}
.nav a {
  position: relative; text-decoration: none; color: var(--white);
  font-family: var(--f-head); font-size: var(--fs-nav);
  text-transform: uppercase; letter-spacing: 0.18em;
  padding: 10px 0; transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 4px; height: 2px; width: 0;
  background: var(--red); transition: width .25s ease;
}
.nav a:hover { color: var(--cream); }
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }

/* ---------- Bottom bar ---------- */
.botbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--band);
  background: var(--black); z-index: 20;
}
.botbar-in {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(80px * var(--s));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(24px * var(--s) + 8px) 0 calc(100px * var(--s));
}
.wa {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white);
  height: calc(36px * var(--s) + 14px); padding: 0 18px 0 14px;
  border: 2px solid var(--white); font-family: var(--f-head); text-transform: uppercase;
  letter-spacing: 0.18em; font-size: 12px;
  transition: background .25s, color .25s, border-color .25s;
}
.wa svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wa:hover { background: var(--cream); border-color: var(--cream); color: var(--black); }
.social { display: flex; align-items: center; gap: calc(14px * var(--s) + 4px); }
.social a {
  position: relative; display: grid; place-items: center;
  width: calc(44px * var(--s) + 12px); height: calc(44px * var(--s) + 12px);
  color: var(--white); transition: color .2s, transform .2s;
}
.social svg {
  width: calc(24px * var(--s) + 8px); height: calc(24px * var(--s) + 8px);
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.social a::after {
  content: ""; position: absolute; left: 25%; right: 25%; bottom: 2px; height: 2px;
  background: var(--red); transform: scaleX(0); transition: transform .25s ease;
}
.social a:hover { color: var(--cream); transform: translateY(-2px); }
.social a:hover::after { transform: scaleX(1); }

@media (max-width: 560px) {
  .wa { padding: 0; width: calc(36px * var(--s) + 14px); justify-content: center; }
  .wa span { display: none; }
  .social { gap: 6px; }
  .botbar-in { padding-left: calc(100px * var(--s)); padding-right: 6px; }
}

/* ---------- Page area ---------- */
main {
  /* content starts exactly at the bottom edge of the logo (126.5px in the 1920 layout) */
  padding: calc(126.5px * var(--s)) var(--pad-r)
           calc(var(--band) + 44px * var(--s) + 8px) var(--pad-l);
  min-height: 100vh;
}
h1, h2 { font-family: var(--f-head); font-weight: 400; text-transform: uppercase; margin: 0; }

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 14px; color: var(--white); background: transparent;
  border: 2px solid var(--white); padding: 17px 44px;
  transition: background .25s, color .25s, border-color .25s;
}
.btn:hover { background: var(--cream); border-color: var(--cream); color: var(--black); }

/* ---------- Home ---------- */
main.home {
  padding-top: calc(var(--band) + 60px * var(--s) + 22px);
  height: 100vh; height: 100svh; min-height: 560px;
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--band) + 8px);
}
.duo {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
}
.tile { position: relative; display: block; overflow: hidden; background: #111; text-decoration: none; }
.tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.72) 100%);
}
.tile:hover img { transform: scale(1.04); }
.tile-label {
  position: absolute; z-index: 2; left: clamp(18px, 2.2vw, 36px); bottom: clamp(18px, 2.2vw, 34px);
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: clamp(20px, 2.1vw, 34px); line-height: 1.25; color: var(--white); right: 16px;
}
.tile-label .nw { white-space: nowrap; }
.tile-label .sep { color: var(--red); margin: 0 .1em 0 .25em; }
.tile-label::before {
  content: ""; display: block; width: 44px; height: 2px; background: var(--red);
  margin-bottom: 14px; transition: width .35s ease;
}
.tile:hover .tile-label::before { width: 96px; }
.cta { flex: none; display: flex; justify-content: center; padding-top: 30px; padding-bottom: 6px; }

@media (max-width: 760px) {
  main.home { height: auto; min-height: 100svh; }
  .duo { grid-template-columns: 1fr; flex: none; }
  .tile { height: 36svh; min-height: 220px; }
  .cta { padding-top: 24px; }
  .btn { padding: 15px 34px; font-size: 12px; }
}

/* ---------- Projects + project galleries ---------- */
.tabs { display: flex; gap: clamp(22px, 4vw, 56px); margin-bottom: clamp(26px, 3.4vw, 48px); }
.tabs .tab {
  line-height: 1;
  position: relative; text-decoration: none; font-family: var(--f-head);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: clamp(16px, 2.1vw, 30px); color: rgba(255,255,255,.5);
  padding-bottom: 10px; transition: color .2s;
}
.tabs .tab::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--red); transition: width .25s ease;
}
.tabs .tab:hover { color: var(--white); }
.tabs .tab.on { color: var(--white); }
.tabs .tab.on::after, .tabs .tab:hover::after { width: 100%; }
.tabs h1.tab { margin: 0; font-weight: 400; }

.grid {
  --col: 300px;
  display: grid; gap: calc(var(--gap) + 6px) var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(var(--col), 1fr));
}
.grid.gallery { --col: 250px; gap: var(--gap); }
@media (max-width: 700px) {
  .grid, .grid.gallery { --col: 130px; }
}

.pcard { display: block; text-decoration: none; color: var(--white); }
.ph { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #111; }
.ph img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.ph::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--red);
  transition: width .4s ease;
}
.pcard:hover .ph img { transform: scale(1.04); }
.pcard:hover .ph::after { width: 100%; }
.pname {
  margin-top: 14px; font-weight: 600; font-size: 14px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--white);
}
.pmeta { margin-top: 2px; font-size: 13px; color: var(--cream); font-weight: 300; letter-spacing: 0.03em; }
@media (max-width: 700px) {
  .pname { font-size: 11.5px; margin-top: 10px; }
  .pmeta { font-size: 11px; }
}

.back {
  display: inline-grid; place-items: center; width: 46px; height: 46px; margin: -6px 0 22px -10px;
  color: var(--white); transition: color .2s, transform .2s;
}
.back svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--cream); transform: translateX(-3px); }

/* project gallery: every image keeps its own shape, laid out in tidy rows */
.gallery-flow { --rh: 440px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gap); }
.gallery-flow::after { content: ""; flex-grow: 1000000; }
.gimg {
  --r: 0.5625;
  display: block; padding: 0; border: 0; background: #111; cursor: zoom-in; overflow: hidden;
  aspect-ratio: var(--r);
  flex: calc(var(--r) * 100) 1 calc(var(--rh) * var(--r));
  min-width: 0; max-width: 100%;
}
.gimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.gimg:hover img { transform: scale(1.04); }
@media (max-width: 1100px) { .gallery-flow { --rh: 340px; } }
/* projects with only a few photos: show them larger */
@media (min-width: 701px) { .gallery-flow.few { --rh: min(64vh, 620px); } }
@media (max-width: 700px) {
  .gallery-flow::after { display: none; }
  .gimg { flex: 0 0 calc(50% - var(--gap) / 2); }
  .gimg.wide { flex-basis: 100%; }
}

.empty { color: rgba(255,255,255,.6); font-weight: 300; }

/* ---------- Lightbox (images only, no text) ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.97);
  display: none; align-items: center; justify-content: center;
}
.lb.open { display: flex; }
.lb img { max-width: 92vw; max-height: 92vh; max-height: 92svh; object-fit: contain; }
.lb button {
  position: absolute; background: none; border: 0; color: var(--white); cursor: pointer;
  width: 56px; height: 56px; display: grid; place-items: center; transition: color .2s;
}
.lb button:hover { color: var(--cream); }
.lb svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lb .x { top: 14px; right: 14px; }
.lb .prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb .next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb .red { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red); }

/* ---------- Monochrome until hover (desktop with a mouse only) ---------- */
@media (hover: hover) and (min-width: 1025px) {
  .tile img, .ph img {
    filter: grayscale(1);
    transition: filter .6s ease, transform .8s cubic-bezier(.2,.7,.2,1);
  }
  .tile:hover img, .pcard:hover .ph img { filter: grayscale(0); }
}

/* ---------- About / Contact ---------- */
.page-title { font-size: clamp(34px, 5.2vw, 84px); letter-spacing: 0.03em; line-height: 1; margin: 0; }
.page-title::after { content: ""; display: block; width: 64px; height: 2px; background: var(--red); margin-top: 22px; }
.about-grid {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(200px, 20vw, 340px);
  grid-template-rows: auto 1fr;
  grid-template-areas: "title photos" "text photos";
  column-gap: clamp(28px, 5vw, 96px);
}
.about-grid .page-title { grid-area: title; }
.about-grid .about-text { grid-area: text; }
.about-photos { grid-area: photos; display: flex; flex-direction: column; gap: var(--gap); }
.ap { aspect-ratio: 3 / 4; overflow: hidden; background: #111; }
.ap img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "title" "photos" "text"; }
  .about-photos { flex-direction: row; margin-top: clamp(24px, 4vw, 40px); }
  .about-photos .ap { flex: 1 1 0; min-width: 0; }
}
.about-text { max-width: 760px; }
.prose { max-width: 640px; margin-top: clamp(28px, 4vw, 52px); font-weight: 300; font-size: clamp(15px, 1.3vw, 18px); }
.prose p { margin: 0 0 1.2em; }
.contact-list { list-style: none; padding: 0; margin: clamp(28px, 4vw, 52px) 0 36px; display: grid; gap: 22px; }
.contact-list small {
  display: block; font-family: var(--f-head); text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 11px; color: var(--cream); margin-bottom: 4px;
}
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.map { width: 100%; min-width: 0; max-width: 100%; aspect-ratio: 4 / 3; min-height: 300px; border: 2px solid var(--line); background: #111; margin: 0; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(1) invert(.92) contrast(.9); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } .map { margin-top: 8px; } }
.contact-list a, .contact-list span { overflow-wrap: anywhere; font-size: clamp(16px, 1.6vw, 22px); font-weight: 300; text-decoration: none; }
.contact-list a:hover { color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* visually hidden but readable by screen readers and search engines */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tile-label { margin: 0; font-weight: 400; }
