/* ============================================================
   Boston Defense
   Black, white, one grey. The photographs carry the colour.
   An editorial page: full bleed plates, a statement at display size,
   and copy pushed into a right hand column.
   ============================================================ */

:root{
  --bg:    #000000;
  --fg:    #FFFFFF;
  --body:  #F4F4F4;
  --grey:  #8C8C8C;   /* the dimmed phrase, list heads, captions */
  --grey-2:#636363;
  --rule:  #262626;

  /* Libre Franklin descends from Franklin Gothic, the face of American
     civic and public printing. Institutional by lineage. */
  --sans: 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* lifted from the crest */
  --crimson: #B20C1E;
  --slate:   #647388;
  --nav-h: clamp(56px, 5vw, 80px);

  --ease: cubic-bezier(.16,1,.3,1);

  /* the page gutter, matched to the reference's hairline margin */
  --edge: clamp(10px, 1.2vw, 20px);

  /* the two indents the whole page is built on */
  --indent-half:  50.5%;
  --indent-third: 62%;

  --fs-body:  clamp(12px, .92vw, 15px);   /* captions, credit */
  --fs-read:  clamp(15px, 1.22vw, 20px);  /* chapter copy */
  --fs-lead:  clamp(16px, 1.34vw, 22px);  /* the mission, which leads */
  --lh-body: 1.46;
}

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

html{ background:var(--bg); scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--bg);
  color:var(--body);
  font-family:var(--sans);
  font-size:var(--fs-body);
  line-height:var(--lh-body);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
}

img{ display:block; width:100%; height:auto; }
a{ color:inherit; text-decoration:none; }
h1,h2,p,ul,figure,figcaption{ margin:0; }
ul{ list-style:none; padding:0; }
::selection{ background:var(--fg); color:var(--bg); }

.dim{ color:var(--grey); }

/* ============================================================
   NAV: light bar, crest hard left, links right
   ============================================================ */
.nav{
  height:var(--nav-h);
  background:var(--bg);
  color:var(--fg);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 calc(var(--edge) + 4px);
}
.nav__logo{ display:flex; align-items:center; gap:clamp(8px,.9vw,14px); }
.nav__logo img{
  height:clamp(30px, 3.1vw, 50px);
  width:auto;
}
.nav__word{
  font-weight:300;
  letter-spacing:-.005em;
  font-size:clamp(16px, 1.42vw, 25px);
  white-space:nowrap;
  color:var(--fg);
}
.nav__links{ display:flex; gap:clamp(13px, 1.75vw, 36px); }
.nav__links a{
  font-size:clamp(12px, .95vw, 16px);
  font-weight:500;
  letter-spacing:-.004em;
  transition:color .2s var(--ease);
}
.nav__links a:hover{ color:var(--crimson); }
.nav__cta{
  color:var(--fg);
  border-bottom:1px solid var(--grey-2);
  padding-bottom:2px;
}
.nav__cta:hover{ border-color:var(--crimson); }

/* ============================================================
   MISSION
   ============================================================ */
.label{
  font-size:clamp(1.15rem, 2.2vw, 2.3rem);
  font-weight:600;
  line-height:1.06;
  letter-spacing:-.015em;
  text-transform:uppercase;
  color:var(--fg);
}
.col--half .label{ margin-bottom:1.1em; }

/* ============================================================
   FULL BLEED PLATES
   ============================================================ */
.bleed{
  margin:0 var(--edge);
}

main > .bleed:first-child{ margin-top:0; }

/* ============================================================
   THE STATEMENT
   ============================================================ */
.statement{
  padding:clamp(22px,2.6vw,46px) var(--edge) clamp(54px,8vw,130px);
}
.statement p{
  font-size:clamp(1.38rem, 3.08vw, 3.3rem);
  line-height:1.1;
  letter-spacing:-.017em;
  font-weight:600;
  text-transform:uppercase;
  color:var(--fg);
  max-width:100%;
  /* flush both edges; the closing line stays ranged left */
  text-align:justify;
  text-align-last:left;
  hyphens:none;
}

/* ============================================================
   INDENTED COLUMN
   ============================================================ */
.intro{
  display:grid;
  grid-template-columns:37% 1fr;
  column-gap:13.5%;           /* so the copy still starts on the half indent */
  align-items:start;
  padding:0 var(--edge) clamp(54px,8vw,130px);
}
.intro__plate{ grid-column:1; }

.col--half{
  grid-column:2;
  width:100%;
  padding-right:3.7%;
}
.col--half p + p{ margin-top:1.3em; }

/* the mission reads as the thesis, so it sits above body size and in white */
.col--half p{
  font-size:var(--fs-lead);
  line-height:1.5;
  color:var(--body);
  letter-spacing:-.003em;
}
.col--half .label{ display:block; margin-bottom:.7em; }

/* ============================================================
   SYSTEMS: two equal spaces, left undrawn. The 3D files are the
   content; a frame around nothing is just decoration.
   ============================================================ */
.stages{
  padding:clamp(12px,1.5vw,24px) var(--edge) clamp(54px,8vw,130px);
}
.stages__label{
  display:block;
  font-size:clamp(1.15rem, 2.2vw, 2.3rem);
  font-weight:600; line-height:1.06; letter-spacing:-.015em;
  text-transform:uppercase; color:var(--fg);
  margin-bottom:clamp(22px,3.4vw,52px);
}
.stages__pair{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  column-gap:clamp(18px,3vw,54px);
  align-items:start;
}
.stage{ display:flex; flex-direction:column; min-width:0; }

.stage__frame{
  aspect-ratio:4/3;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.stage__frame img{
  width:100%; height:100%;
  object-fit:contain;
  background:transparent;
}
/* The viewer sets touch-action:none on its canvas, which traps a thumb.
   pan-y gives the page its vertical scroll back and leaves the
   horizontal drag to the model. */
.stage__frame canvas{ touch-action:pan-y !important; }

/* ============================================================
   OUTRO: one word, centred, nothing around it
   ============================================================ */
.outro{
  padding:clamp(40px,6vw,96px) var(--edge) clamp(14px,1.8vw,24px);
  display:grid;
  grid-template-columns:var(--indent-third) 1fr;
}
.outro__cta{
  grid-column:2;
  justify-self:start;
  font-size:clamp(10px,.78vw,12px);
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--grey);
  transition:color .22s var(--ease);
}
.outro__cta:hover{ color:var(--fg); }

/* ============================================================
   CHAPTERS: title left, copy at the second indent, tops aligned
   ============================================================ */
.chapter{
  display:grid;
  grid-template-columns:var(--indent-third) 1fr;
  align-items:start;
  padding:clamp(12px,1.5vw,24px) var(--edge) clamp(54px,8vw,130px);
}
.chapter h2{
  font-size:clamp(1.2rem, 2.85vw, 3.05rem);
  line-height:1.06;
  letter-spacing:-.017em;
  font-weight:600;
  text-transform:uppercase;
  color:var(--fg);
}
.chapter__body{ padding-right:3.7%; }
.chapter__body p{
  font-size:var(--fs-read);
  line-height:1.52;
  color:var(--body);
  letter-spacing:-.003em;
}
.chapter__body p + p{ margin-top:1.4em; }

/* ============================================================
   CREDIT
   ============================================================ */
.credit{
  padding:0 var(--edge) clamp(16px,2vw,28px);
  color:var(--grey-2);
  font-size:clamp(10px,.72vw,12px);
}

/* ============================================================
   MOTION: resting states. JS only adds classes.
   ============================================================ */

/* word and character splitting for the type on */
.split{ display:inline; }
.w{ display:inline-block; white-space:nowrap; }
/* A character either has been typed or it has not. No fade: the soft
   gradient edge read as an effect rather than as typing. */
.ch{ display:inline-block; }
.js .ch{ visibility:hidden; }
.ch.is-on{ visibility:visible; }

/* The caret is its own zero width node, so moving it never reflows.
   A thin rule reads as a cursor; the heavy block it replaced read
   as a rendering fault. */
.caret{
  position:relative;
  display:inline-block;
  width:0; height:1em;
  vertical-align:text-bottom;
}
.caret::before{
  content:'';
  position:absolute;
  left:.08em; bottom:.02em;
  width:.075em; min-width:1.5px;
  height:.92em;
  background:var(--fg);
  opacity:.92;
  transition:opacity .24s linear;
}
.caret--done::before{ opacity:0; }

.sr-only{
  position:absolute;
  width:1px; height:1px;
  margin:-1px; padding:0; border:0;
  clip-path:inset(50%);
  overflow:hidden; white-space:nowrap;
  -webkit-user-select:none;
  user-select:none;
}

/* Photographs wipe up and settle out of their oversize.
   The clip lives on .shade, never on the observed figure: an element
   clipped to nothing reports an empty intersection rect and the
   observer would never fire. */
.shade{ display:block; overflow:hidden; }
/* The clip is only applied when JS is running. Without this guard a
   blocked or slow script leaves every photograph clipped to nothing
   and the page renders black. */
.js .shade{
  clip-path:inset(0 0 100% 0);
  transition:clip-path 1.05s var(--ease);
}
[data-img].is-in .shade{ clip-path:inset(0 0 0 0); }

.js .shade img{
  transform:translate3d(0, var(--par, 0px), 0) scale(1.07);
  transition:transform 1.5s var(--ease);
  will-change:transform;
}
[data-img].is-in .shade img{ transform:translate3d(0, var(--par, 0px), 0) scale(1); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px){
  :root{ --fs-body:14px; --lh-body:1.5; }

  .statement p{ max-width:none; }

  .intro{ grid-template-columns:1fr; row-gap:clamp(22px,5vw,40px); }
  .intro__plate{ grid-column:1; }
  .col--half{ grid-column:1; padding-right:0; }
  .statement p{ text-align:left; }

  .chapter{ grid-template-columns:1fr; gap:clamp(14px,3vw,24px); }
  .outro{ grid-template-columns:1fr; }
  .outro__cta{ grid-column:1; }
  .chapter__body{ padding-right:0; }

  .stages__pair{ grid-template-columns:1fr; row-gap:clamp(30px,7vw,54px); }


  .nav__word{ font-size:14px; }
}

@media (max-width: 560px){
  .nav__word{ display:none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
  .ch{ visibility:visible; }
  .caret{ display:none; }
  .shade{ clip-path:none; }
  .shade img{ transform:none; }
}

/* ============================================================
   CONTACT PAGE: a narrow column, centred on the page, ranged left
   inside it. Centred prose reads as a brochure; ranged left reads
   as correspondence.
   ============================================================ */
.contact{
  padding:clamp(34px,5vw,70px) var(--edge) clamp(60px,9vw,130px);
  max-width:600px;
  margin:0 auto;
}

.contact__title{
  font-size:clamp(1.7rem, 3.4vw, 3rem);
  line-height:1;
  letter-spacing:-.02em;
  font-weight:600;
  text-transform:uppercase;
  color:var(--fg);
}
.contact__lede{
  margin-top:clamp(14px,1.8vw,22px);
  font-size:var(--fs-read);
  line-height:1.52;
  color:var(--fg);
  max-width:46ch;
}

#form{ margin-top:clamp(40px,6vw,80px); }

.field{ margin:0 0 clamp(24px,2.8vw,36px); display:flex; flex-direction:column; gap:.6em; }
.field > label,
.field legend{
  font-size:clamp(10px,.78vw,12px);
  letter-spacing:.16em; text-transform:uppercase; color:var(--fg);
  padding:0;
}

input[type=text], input[type=email], textarea{
  font:inherit;
  font-size:var(--fs-read);
  color:var(--fg);
  background:transparent;
  border:0;
  border-bottom:1px solid var(--rule);
  padding:.45em 0;
  width:100%;
  border-radius:0;
  transition:border-color .22s var(--ease);
}
input:focus, textarea:focus{ outline:none; border-bottom-color:var(--fg); }
input::placeholder, textarea::placeholder{ color:var(--grey-2); }
textarea{ resize:vertical; min-height:6.5em; line-height:1.52; }

fieldset.field{ border:0; margin-inline:0; padding:0; }
.choices{ display:flex; flex-wrap:wrap; gap:0 1.6em; }
.choices label{ cursor:pointer; }
.choices input{ position:absolute; opacity:0; width:0; height:0; }
.choices span{
  display:inline-block;
  padding:.35em 0;
  font-size:var(--fs-read);
  color:var(--body);
  border-bottom:1px solid transparent;
  transition:color .22s var(--ease), border-color .22s var(--ease);
}
.choices label:hover span{ color:var(--fg); }
.choices input:checked + span{ color:var(--fg); border-bottom-color:var(--fg); }
.choices input:focus-visible + span{ color:var(--fg); }

.honey{ display:none; }

.submit{
  margin-top:clamp(14px,1.8vw,24px);
  font:inherit;
  font-size:clamp(10px,.78vw,12px);
  font-weight:500; letter-spacing:.16em; text-transform:uppercase;
  color:var(--fg);
  background:transparent;
  border:0;
  border-bottom:1px solid var(--fg);
  padding:0 0 5px;
  cursor:pointer;
  transition:color .22s var(--ease), border-color .22s var(--ease);
}
.submit:hover{ color:var(--grey); border-bottom-color:var(--grey); }


.sent{ margin-top:clamp(40px,6vw,80px); }
.sent__head{
  font-size:clamp(1.3rem,2.4vw,2.1rem);
  font-weight:600; letter-spacing:-.02em; text-transform:uppercase;
  color:var(--fg); margin-bottom:.6em;
}
.sent p{ font-size:var(--fs-read); line-height:1.52; color:var(--fg); max-width:44ch; }
.sent__back{
  display:inline-block; margin-top:2em;
  font-size:clamp(10px,.78vw,12px);
  letter-spacing:.16em; text-transform:uppercase; color:var(--grey);
  border-bottom:1px solid var(--rule); padding-bottom:4px;
  transition:color .22s var(--ease), border-color .22s var(--ease);
}
.sent__back:hover{ color:var(--fg); border-bottom-color:var(--fg); }
