/* ==========================================================================
   ineffablebeast.in
   ========================================================================== */

:root{
  /* paper. original spec was #F7F6F2; toned twice, now ~13% below it.
     revert by setting this back to #F7F6F2 and --rule to #DAD8D1. */
  --paper:#E9E7DF;
  --ink:#111111;
  --ink-2:#6F6E69;
  --ink-3:#999891;
  --rule:#CECCC4;           /* tracks the paper, holds the hairlines */
  --on-dark:#F7F6F2;        /* text on the dark panel, kept bright */

  --font:"SF Pro Display","Geist Sans","Geist","Inter",
         -apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif;

  --gutter:clamp(24px,4.4vw,68px);
  --shell:1680px;
  --ease:cubic-bezier(.2,.75,.25,1);
}

*{margin:0;padding:0;box-sizing:border-box}

html,body{height:100%}

body{
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-feature-settings:"kern" 1,"liga" 1,"calt" 1;
  overflow:hidden;
}

a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
img{display:block;max-width:100%;height:auto}
::selection{background:rgba(17,17,17,.1)}
:focus-visible{outline:1px solid var(--ink-2);outline-offset:4px}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:.001ms!important}
}

/* ==========================================================================
   shell
   ========================================================================== */
.page{
  height:100vh;height:100dvh;
  max-width:var(--shell);
  margin:0 auto;
  padding:clamp(22px,2.6vh,28px) var(--gutter) 0;
  display:grid;
  grid-template-rows:auto 1fr;
}

/* ---------------- masthead ---------------- */
.masthead{
  display:flex;align-items:center;justify-content:space-between;
  height:32px;
}
.masthead__id{display:inline-flex;align-items:baseline;gap:13px}
.monogram{
  width:14px;height:14px;color:var(--ink);
  display:inline-block;transform:translateY(2px);
}
.monogram svg{display:block;width:100%;height:100%}
.wordmark{
  font-size:12.5px;font-weight:550;
  letter-spacing:.11em;text-transform:uppercase;
  color:var(--ink);
}
.masthead__year{
  font-size:12.5px;font-weight:500;letter-spacing:.08em;
  color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}

/* ==========================================================================
   composition
   ========================================================================== */
.main{
  display:grid;
  align-content:center;
  padding-bottom:clamp(28px,7vh,84px);   /* bias the block slightly above centre */
  min-height:0;
}

/* headline + plate = one unit */
.unit{
  display:flex;
  align-items:center;
  gap:clamp(20px,2.3vw,40px);
}

.headline{
  flex:0 1 auto;
  min-width:0;
  /* three-line stack; capped so the type stops outgrowing the shell */
  font-size:clamp(2.2rem,6.6vw,7rem);
  font-weight:500;
  line-height:.95;
  letter-spacing:-.046em;
  color:var(--ink);
  text-wrap:balance;
}
.headline__row{display:block}

/* the plate is mounted: a hairline frame with a thin paper mat,
   so the dark image reads as an image printed on the page */
/* the screenshot. hidden by default and loaded through CSS, so narrow
   viewports never request the file. switched on at 861px and up. */
.plate{display:none}
.plate__shot{
  aspect-ratio:1440 / 544;
  background:url("assets/plate.png") center / cover no-repeat;
  border-radius:3px;
}

/* ---------------- the note, set as type ---------------- */
.note{
  /* sits below the actions, so it needs a clear break above it */
  margin:clamp(30px,4.4vh,48px) 0 0;
  max-width:620px;
  background:var(--ink);
  border-radius:10px;
  padding:clamp(19px,5vw,27px) clamp(19px,5vw,26px) clamp(21px,5.4vw,28px);
}
.note__from{
  font-size:12px;
  font-weight:450;
  letter-spacing:.01em;
  color:rgba(247,246,242,.46);
  margin-bottom:clamp(14px,3.4vw,18px);
}
.note__lines{
  font-size:clamp(16.5px,4.6vw,20px);
  font-weight:450;
  line-height:1.34;
  letter-spacing:-.016em;
  color:var(--on-dark);
}
.note__lines span{display:block}
.note__body{
  margin-top:clamp(15px,3.6vw,19px);
  font-size:clamp(14px,3.7vw,15.5px);
  font-weight:400;
  line-height:1.56;
  letter-spacing:-.006em;
  color:rgba(247,246,242,.68);
}

/* above 860 the artefact itself carries the message; the typed note stays
   in the accessibility tree but leaves the layout */
@media (min-width:861px){
  .plate{
    display:block;
    flex:0 0 clamp(300px,43vw,760px);
    margin:0;
    padding:clamp(8px,.8vw,13px);
    border:1px solid var(--rule);
    border-radius:8px;
  }
  .note{
    position:absolute;
    width:1px;height:1px;
    margin:0;padding:0;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
}

/* ---------------- caption ---------------- */
.caption{
  margin-top:clamp(18px,2.6vh,30px);
  font-size:clamp(13.5px,.95vw,15.5px);
  font-weight:400;
  letter-spacing:-.002em;
  color:var(--ink-2);
}

/* ---------------- actions ---------------- */
.actions{
  margin-top:clamp(20px,2.8vh,32px);
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
}
.control{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:46px;padding:0 24px;
  border-radius:5px;
  border:1px solid transparent;
  font-size:13.5px;font-weight:500;letter-spacing:-.002em;
  white-space:nowrap;
  transition:background-color .4s var(--ease),border-color .4s var(--ease),
             color .4s var(--ease);
}
.control--outline{
  color:var(--ink);
  border-color:var(--rule);
  background-color:transparent;
}
.control--outline:hover{
  border-color:#BAB8B0;
  background-color:rgba(17,17,17,.028);
}
.control--solid{
  background-color:var(--ink);
  color:var(--on-dark);
  border-color:var(--ink);
}
.control--solid:hover{background-color:#1F1F1F;border-color:#1F1F1F}
.control__mark{
  display:inline-block;font-size:12px;
  transition:transform .4s var(--ease);
}
.control--solid:hover .control__mark{transform:translate(3px,-3px)}

/* ==========================================================================
   entrance — small distance, slow, quiet
   ========================================================================== */
/* scoped to .js so the page is never blank if the script fails to run */
.js [data-in]{opacity:0;transform:translateY(12px)}
.js .plate[data-in],.js .note[data-in]{transform:translateY(14px)}
.ready [data-in]{
  opacity:1;transform:none;
  transition:opacity .72s var(--ease),transform .78s var(--ease);
}
.ready [data-in="1"]{transition-delay:.04s}
.ready [data-in="2"]{transition-delay:.10s}
.ready [data-in="3"]{transition-delay:.18s}
.ready [data-in="4"]{transition-delay:.26s}
.ready [data-in="5"]{transition-delay:.38s}
.ready [data-in="6"]{transition-delay:.52s}
.ready [data-in="7"]{transition-delay:.62s}
.ready [data-in="8"]{transition-delay:.72s}

/* ==========================================================================
   projects sheet
   ========================================================================== */
.sheet{
  position:fixed;inset:0;z-index:40;
  background:var(--paper);
  opacity:0;
  transition:opacity .42s var(--ease);
  overflow-y:auto;
}
.sheet[hidden]{display:none}
.sheet.is-open{opacity:1}

.sheet__inner{
  max-width:var(--shell);
  margin:0 auto;
  padding:clamp(22px,2.6vh,28px) var(--gutter) clamp(40px,8vh,96px);
  min-height:100dvh;
}
.sheet__top{
  display:flex;align-items:center;justify-content:space-between;
  height:32px;
  margin-bottom:clamp(44px,9vh,110px);
}
.sheet__title{
  font-size:12.5px;font-weight:550;
  letter-spacing:.11em;text-transform:uppercase;
  color:var(--ink);
}
.sheet__close{
  font-size:12.5px;font-weight:500;letter-spacing:.08em;
  color:var(--ink-3);
  transition:color .35s var(--ease);
}
.sheet__close:hover{color:var(--ink)}

.sheet__list{border-top:1px solid var(--rule)}

.entry{
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  align-items:baseline;
  gap:0 clamp(20px,4vw,60px);
  padding:clamp(30px,5vh,54px) 0;
  border-bottom:1px solid var(--rule);
}
.entry__no{
  font-size:12.5px;font-weight:500;letter-spacing:.08em;
  color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}
.entry__name{
  font-size:clamp(1.9rem,4.4vw,3.1rem);
  font-weight:500;line-height:1;letter-spacing:-.042em;
  color:var(--ink);
}
.entry__desc{
  margin-top:15px;max-width:44ch;
  font-size:clamp(13.5px,.95vw,15.5px);
  line-height:1.6;
  color:var(--ink-2);
}
.entry__state{
  margin-top:20px;
  font-size:11.5px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink-3);
}
.entry__open{
  display:inline-flex;align-items:center;gap:8px;
  font-size:13.5px;font-weight:500;
  color:var(--ink);
  padding-bottom:3px;
  border-bottom:1px solid var(--rule);
  white-space:nowrap;
  transition:border-color .4s var(--ease);
}
.entry__open:hover{border-color:var(--ink)}
.entry__open span{
  display:inline-block;font-size:12px;
  transition:transform .4s var(--ease);
}
.entry__open:hover span{transform:translate(3px,-3px)}

/* ==========================================================================
   responsive — recompose, don't just shrink
   ========================================================================== */

/* tighten the pairing before it breaks */
@media (max-width:1180px){
  .headline{font-size:clamp(2.1rem,6.4vw,5.4rem);letter-spacing:-.042em}
  .plate{flex-basis:clamp(280px,42vw,520px)}
}

/* ---- tablet / large phone: stack, plate directly beneath the headline ---- */
@media (max-width:860px){
  body{overflow:auto}
  .page{height:auto;min-height:100dvh}
  .main{
    align-content:center;
    padding-top:clamp(20px,3.6vh,44px);
    padding-bottom:clamp(32px,5.5vh,64px);
  }
  .unit{display:block}
  .headline{font-size:clamp(2.6rem,8.4vw,4.6rem);letter-spacing:-.036em}
  .caption{margin-top:clamp(18px,2.4vh,28px)}
  .actions{margin-top:clamp(18px,2.4vh,28px)}

  /* the plate (step 5) does not render here, so close the gap it leaves */
  .ready [data-in="6"]{transition-delay:.36s}
  .ready [data-in="7"]{transition-delay:.46s}
  .ready [data-in="8"]{transition-delay:.58s}

  .sheet__top{margin-bottom:clamp(36px,6vh,72px)}
  .entry{grid-template-columns:1fr}
  .entry__no{margin-bottom:12px}
  .entry__open{margin-top:24px}
}

/* ---- phone: the headline carries the page, so let it be big ---- */
@media (max-width:520px){
  /* the 3-line stack needs only ~6.2em, so there is room for far more scale */
  .headline{
    font-size:clamp(2.2rem,12.5vw,3.6rem);
    line-height:.97;
    letter-spacing:-.032em;
  }
  .caption{
    font-size:14px;
    margin-top:clamp(16px,2.2vh,24px);
  }
  /* natural width, left-anchored — matching desktop, not stretched edge to edge */
  .actions{margin-top:clamp(18px,2.4vh,26px);gap:9px}
  .control{height:44px;padding:0 20px;font-size:13px}

  .note{
    max-width:100%;
    border-radius:9px;
    margin-top:clamp(26px,3.8vh,38px);
  }

  .monogram{width:13px;height:13px}
  .wordmark{font-size:11.5px;letter-spacing:.1em}
  .masthead__year{font-size:11.5px}

  .sheet__inner{padding-bottom:clamp(32px,6vh,64px)}
  .entry{padding:clamp(26px,4vh,40px) 0}
  .entry__name{font-size:clamp(1.8rem,9vw,2.4rem)}
  .entry__desc{margin-top:12px}
}

/* ---- very narrow: protect the headline from touching the gutters ---- */
@media (max-width:340px){
  .headline{font-size:11.6vw;letter-spacing:-.028em}
  .control{padding:0 16px;font-size:12.5px}
  .actions{gap:8px}
}

/* short desktop viewports: release the lock rather than crush the type */
@media (max-height:640px) and (min-width:861px){
  body{overflow:auto}
  .page{height:auto;min-height:100dvh}
  .main{padding-top:40px;padding-bottom:48px}
}
