/* ==========================================================================
   IBF — Italian Building Factory
   Redesign proposal. Single page, static, no build step.

   The photography carries the page; the typography stays quiet.
   Paper ground for the work, one continuous dark field for the studio.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
  /* Paper: a cool, slightly green-grey stock — tracing paper, not cream. */
  --paper:        #E9E7E1;
  --paper-deep:   #DEDBD3;
  --paper-line:   #C6C2B8;

  /* Ink: graphite, cool, never pure black. */
  --ink:          #14161A;
  --ink-soft:     #3A3D42;
  --stone:        #6E6D68;

  /* On the dark field. */
  --dark-line:    rgba(233, 231, 225, 0.16);
  --dark-soft:    rgba(233, 231, 225, 0.66);

  /* The single accent: IBF's own brand red, lifted from their logo.svg. */
  --red:          #C2000B;

  --gutter:       clamp(20px, 5vw, 72px);
  --max:          1600px;
  /* Side padding that equals the gutter on normal screens and grows on very
     wide ones, so text blocks stay centred at --max while images run edge
     to edge. */
  --pad:          max(var(--gutter), calc((100vw - var(--max)) / 2));
  --measure:      62ch;

  --font-display: "Host Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-data:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: clamp(16px, 0.6vw + 8.5px, 19px);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }

::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ------------------------------------------------------- type utilities -- */
/* Sentence case, light weight, tight leading: the size does the work, not
   the weight. Headlines should read as spoken, not shouted. */
.display {
  font-family: var(--font-display);
  font-weight: 350;
  line-height: 1.04;
  letter-spacing: -0.032em;
}

.label {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ------------------------------------------------------------- topbar --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad);
  transition: background 240ms ease, color 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}
.topbar--over  { color: #fff; }
.topbar--paper {
  background: rgba(233, 231, 225, 0.97);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--paper-line);
  color: var(--ink);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}
.brand__sub {
  display: block;
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.2em;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 4px;
}
.topbar--over .brand img { filter: brightness(0) invert(1); }

.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 160ms ease;
}
.topnav a:hover { opacity: 1; }
.topnav .cta { border: 1px solid currentColor; padding: 9px 16px; opacity: 1; }
.topnav .cta:hover { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 720px) { .topnav a:not(.cta) { display: none; } }

/* ----------------------------------------------------------------- hero -- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--ink);
  padding: 120px var(--pad) clamp(36px, 5vw, 64px);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img,
.hero__media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 58%;
}
/* The poster is the video's first frame, so the video can sit fully opaque
   from the start: no fade, no visible hand-off, never a black frame. */
.hero__media video { opacity: 1; }
/* Never show Safari's centred play glyph on the hero. */
.hero__media video::-webkit-media-controls,
.hero__media video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(176deg,
    rgba(20,22,26,0.40) 0%, rgba(20,22,26,0.05) 30%, rgba(20,22,26,0.42) 62%, rgba(20,22,26,0.88) 100%);
}
.hero__inner { position: relative; width: 100%; }

.hero h1 {
  font-size: clamp(38px, 6.4vw, 92px);
  max-width: 17ch;
  margin-bottom: clamp(22px, 3vw, 34px);
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 40px;
}
.hero__foot p {
  max-width: 54ch;
  color: rgba(255,255,255,0.92);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.5;
}
.hero__credit { color: rgba(255,255,255,0.62); }

/* ---------------------------------------------------------------- facts -- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--paper-line);
  background: var(--paper-deep);
}
.facts > div {
  padding: 24px clamp(16px, 1.7vw, 26px) 22px;
  border-right: 1px solid var(--paper-line);
}
.facts > div:first-child { padding-left: var(--pad); }
.facts > div:last-child  { border-right: 0; padding-right: var(--pad); }
.facts .n {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(23px, 2.5vw, 32px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-bottom: 9px;
}
.facts .t { font-size: clamp(13px, 0.45vw + 7px, 15px); line-height: 1.45; color: var(--ink-soft); }
@media (max-width: 900px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts > div { padding-inline: var(--gutter); border-bottom: 1px solid var(--paper-line); }
  .facts > div:nth-child(2n) { border-right: 0; }
  .facts > div:nth-last-child(-n+2) { border-bottom: 0; }
}

/* -------------------------------------------------------------- sections -- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 26px var(--gutter);
  align-items: end;
  padding: clamp(60px, 8vw, 112px) var(--pad) clamp(30px, 4vw, 48px);
}
.section-head h2 { font-size: clamp(30px, 4.2vw, 58px); max-width: 16ch; }
.section-head p  { max-width: var(--measure); color: var(--ink-soft); }
@media (max-width: 880px) { .section-head { grid-template-columns: 1fr; align-items: start; } }

/* -------------------------------------------------------------- projects -- */
.work { border-top: 1px solid var(--paper-line); }

.work__media { position: relative; background: var(--paper-deep); }
.work__media img {
  width: 100%;
  height: clamp(320px, 66vh, 780px);
  object-fit: cover;
}
.work__tag {
  position: absolute;
  left: 0; bottom: 0;
  background: var(--paper);
  padding: 10px 18px 9px;
  border-top: 1px solid var(--paper-line);
  border-right: 1px solid var(--paper-line);
}

.work__body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px var(--gutter);
  padding: clamp(30px, 4vw, 54px) var(--pad) clamp(48px, 6vw, 82px);
}
.work__body h3 {
  font-family: var(--font-display);
  font-weight: 350;
  letter-spacing: -0.03em;
  line-height: 1.04;
  font-size: clamp(29px, 3.4vw, 48px);
  margin-bottom: 18px;
}
.work__body p + p { margin-top: 14px; }
.work__body .prose { max-width: var(--measure); color: var(--ink-soft); }

/* The project data block. Keys in mono; every value in one single face, so a
   figure and a sentence never sit in different typefaces down the same list. */
.specs { border-top: 1px solid var(--ink); align-self: start; margin: 0; }
.specs dd { margin: 0; }
.specs div {
  display: grid;
  grid-template-columns: 13ch minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--paper-line);
}
.specs .k {
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  padding-top: 4px;
}
.specs .v {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(15px, 0.55vw + 8px, 18px);
  line-height: 1.45;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}
.specs .v b { font-weight: 600; }
@media (max-width: 880px) {
  .work__body { grid-template-columns: 1fr; }
  .specs div { grid-template-columns: 11ch minmax(0, 1fr); gap: 12px; }
}

/* Three-up strip: the rowing complex and the residential group. */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--paper-line);
  border-block: 1px solid var(--paper-line);
}
.triptych figure { margin: 0; background: var(--paper); }
.triptych img { width: 100%; height: clamp(220px, 30vw, 400px); object-fit: cover; }
.triptych figcaption { padding: 17px 20px 24px; }
.triptych figure:first-child figcaption { padding-left: max(20px, calc(var(--pad) - 0px)); }
.triptych figure:last-child  figcaption { padding-right: max(20px, var(--pad)); }
.triptych h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: -0.018em;
  margin-bottom: 8px;
}
.triptych p { font-size: clamp(14px, 0.5vw + 7.5px, 16.5px); line-height: 1.55; color: var(--ink-soft); }
@media (max-width: 880px) { .triptych { grid-template-columns: 1fr; } }

/* ==========================================================================
   The closing field — studio, competenze, committenti, contatti.
   One continuous dark surface divided by hairlines, so the tail reads as a
   single counterweight to the work instead of four short sections.
   ========================================================================== */
.close { background: var(--ink); color: var(--paper); }
.close .label { color: rgba(233, 231, 225, 0.5); }
.close__row { border-top: 1px solid var(--dark-line); }
.close__row:first-child { border-top: 0; }

/* --- studio ------------------------------------------------------------- */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(34px, 5vw, 72px) var(--gutter);
  padding: clamp(58px, 8vw, 112px) var(--pad) clamp(46px, 6vw, 82px);
}
.studio h2 {
  font-size: clamp(30px, 4vw, 54px);
  max-width: 15ch;
  margin-bottom: clamp(22px, 3vw, 32px);
}
.studio p { max-width: var(--measure); color: var(--dark-soft); }
.studio p + p { margin-top: 16px; }
.studio__aside img { width: 100%; height: clamp(230px, 30vw, 360px); object-fit: cover; }
.studio__people {
  columns: 2;
  column-gap: 30px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.studio__people li {
  font-size: clamp(14px, 0.5vw + 7.5px, 16px);
  padding: 7px 0;
  border-bottom: 1px solid var(--dark-line);
  color: var(--dark-soft);
  break-inside: avoid;
}
@media (max-width: 880px) { .studio { grid-template-columns: 1fr; } }

/* --- competenze --------------------------------------------------------- */
.skills {
  padding: clamp(46px, 6vw, 82px) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
  gap: 28px var(--gutter);
  align-items: start;
}
.skills__intro { margin-top: 14px; color: var(--dark-soft); font-size: clamp(15px, 0.5vw + 8px, 17px); max-width: 26ch; }
.skills__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px clamp(24px, 3vw, 48px);
}
.skills__list h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--dark-line);
  font-size: clamp(16px, 0.55vw + 9px, 19px);
}
.skills__list p { font-size: clamp(14px, 0.5vw + 7.5px, 16.5px); line-height: 1.55; color: var(--dark-soft); }
@media (max-width: 980px) { .skills__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 880px) {
  .skills { grid-template-columns: 1fr; }
  .skills__list { grid-template-columns: 1fr; gap: 20px; }
}

/* --- committenti -------------------------------------------------------- */
.clients { padding: clamp(46px, 6vw, 82px) var(--pad); }
.clients ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 0;
}
.clients li {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(20px, 2.9vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: rgba(233, 231, 225, 0.94);
}
.clients li::after {
  content: "·";
  color: var(--red);
  padding: 0 0.4em;
  font-weight: 600;
}
.clients li:last-child::after { content: ""; padding: 0; }
.clients .note {
  margin-top: clamp(26px, 3.5vw, 42px);
  color: rgba(233, 231, 225, 0.52);
  max-width: var(--measure);
  font-size: 15px;
}

/* --- contatti ----------------------------------------------------------- */
.contact { padding: clamp(52px, 7vw, 96px) var(--pad) clamp(40px, 5vw, 64px); }
.contact h2 { font-size: clamp(32px, 4.8vw, 68px); max-width: 16ch; margin-bottom: 30px; }
.contact__lines { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-bottom: clamp(38px, 5vw, 60px); }
.contact__lines a {
  font-family: var(--font-data);
  font-size: clamp(15px, 1.6vw, 19px);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: 3px;
}
.contact__lines a:hover { color: #fff; border-bottom-width: 2px; }

.offices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--dark-line);
  border: 1px solid var(--dark-line);
}
.offices div { background: var(--ink); padding: 22px 24px 26px; }
.offices .label { display: block; margin-bottom: 10px; }
.offices p { font-size: clamp(15px, 0.5vw + 8px, 17px); line-height: 1.55; color: rgba(233,231,225,0.86); }
@media (max-width: 760px) { .offices { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer -- */
.foot {
  background: var(--ink);
  color: rgba(233, 231, 225, 0.46);
  padding: 24px var(--pad) 34px;
  border-top: 1px solid var(--dark-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
.foot a { color: rgba(233, 231, 225, 0.7); }

/* No scroll-driven reveals on purpose: everything below the fold is already
   visible at rest, so previews, screenshots and slow devices see the page whole. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__media video { display: none; }
}
