/* Hacked Bakery: independent website concept
   Typefaces chosen for this concept (Archivo, Inter). Not a claim about the brand's own fonts. */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --blue: #1239c5;        /* sampled from the original logo field */
  --blue-deep: #0b2a99;
  --cream: #f7f2e8;
  --cream-ink: #fffdf8;
  --ink: #0d1a4d;
  --gutter: clamp(16px, 4.5vw, 64px);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blue);
  color: var(--cream-ink);
  font: 400 1rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--cream); color: var(--blue); padding: 10px 14px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
}
.bar__logo img { width: 52px; }
.bar__nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.bar__nav a {
  font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  padding: 10px 0; background: linear-gradient(currentColor, currentColor) 0 78% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.bar__nav a:hover { background-size: 100% 1px; }

/* ---------- Display type ---------- */
.display {
  font-family: var(--display);
  font-weight: 760;
  font-stretch: 78%;
  letter-spacing: -.025em;
  line-height: .92;
  margin: 0;
  text-wrap: balance;
}
.display--ink { color: var(--blue); }

/* ---------- 1. The box ---------- */
.box {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
  align-items: center;
  padding: 120px var(--gutter) 96px;
}
.box__copy { grid-column: 1 / span 5; align-self: end; padding-bottom: 6vh; }
.box h1 { font-size: clamp(3rem, 6.6vw, 6.5rem); color: var(--cream); }
.box__sub { margin: 28px 0 0; font-size: 1.0625rem; color: rgb(255 253 248 / .82); }
.box__photo {
  grid-column: 7 / span 5;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgb(3 14 60 / .7);
}
.box__photo img { width: 100%; aspect-ratio: 597 / 640; object-fit: cover; }
.lid {
  position: absolute; inset: 0;
  background: var(--blue-deep);
  transform-origin: top;
  transform: scaleY(0);
  pointer-events: none;
}
.box__cue {
  position: absolute; left: var(--gutter); bottom: 28px;
  font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  padding: 10px 0; color: rgb(255 253 248 / .8);
}
.box__cue:hover { color: var(--cream-ink); }

/* Opening: the lid lifts once on load */
.js .lid { transform: scaleY(1); }
.js.is-open .lid { transform: scaleY(0); transition: transform 1.15s var(--ease) .25s; }
.js .box__photo img { transform: scale(1.08); }
.js.is-open .box__photo img { transform: scale(1); transition: transform 1.6s var(--ease) .25s; }
.js .box__copy > * { opacity: 0; transform: translateY(14px); }
.js.is-open .box__copy > * { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js.is-open .box__sub { transition-delay: .55s; }
.js.is-open .box h1 { transition-delay: .35s; }

/* ---------- 2. Inside ---------- */
.inside {
  background: var(--cream);
  color: var(--ink);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(96px, 12vw, 160px);
}
.inside h2 { grid-column: 1 / span 6; grid-row: 1; font-size: clamp(2.6rem, 5.4vw, 5.25rem); align-self: start; }
.inside__main { grid-column: 8 / span 4; grid-row: 1 / span 2; }
.inside__main img { width: 100%; aspect-ratio: 360 / 640; object-fit: cover; }
.inside__macro { grid-column: 2 / span 4; grid-row: 2; align-self: end; margin-top: 72px; }
.inside__macro img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; }
.inside__line {
  grid-column: 2 / span 4; grid-row: 3; margin: 22px 0 0;
  font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
}

/* ---------- 3. Diptych ---------- */
.pair {
  display: grid; grid-template-columns: 1fr 1fr;
  max-width: 1104px; margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter) 0;
}
.pair img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pair__a img { object-position: 50% 45%; }
.pair__b img { object-position: 50% 55%; }

/* ---------- 4. Visit ---------- */
.visit {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
  align-items: center;
  padding: clamp(96px, 13vw, 170px) var(--gutter);
}
.visit__photo { grid-column: 2 / span 4; }
.visit__photo img { width: 100%; aspect-ratio: 361 / 560; object-fit: cover; object-position: 50% 30%; }
.visit__copy { grid-column: 7 / span 5; }
.visit h2 { font-size: clamp(2.6rem, 5vw, 4.75rem); color: var(--cream); }
.visit p { margin: 26px 0 0; max-width: 30ch; color: rgb(255 253 248 / .82); font-size: 1.0625rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px;
  border: 1px solid rgb(255 253 248 / .7); border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: .9375rem;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn:hover { background: var(--cream-ink); color: var(--blue); border-color: var(--cream-ink); }
.btn--solid { background: var(--cream-ink); color: var(--blue); border-color: var(--cream-ink); }
.btn--solid:hover { background: transparent; color: var(--cream-ink); }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  padding: 32px var(--gutter) 40px;
  border-top: 1px solid rgb(255 253 248 / .18);
  font-size: .8125rem;
}
.foot__logo { width: 40px; }
.foot nav { display: flex; gap: 24px; }
.foot nav a { text-decoration: none; padding: 8px 0; }
.foot nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__note { margin: 0; color: rgb(255 253 248 / .6); flex-basis: 100%; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .pair .reveal { transform: none; }
.js .pair__b.reveal { transition-delay: .12s; }

/* ---------- Mid sizes ---------- */
@media (max-width: 1000px) {
  .box__copy { grid-column: 1 / span 6; }
  .box__photo { grid-column: 7 / span 6; }
  .inside__main { grid-column: 7 / span 6; }
  .inside__macro, .inside__line { grid-column: 1 / span 5; }
  .visit__photo { grid-column: 1 / span 5; }
  .visit__copy { grid-column: 7 / span 6; }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .bar { padding-top: 14px; }
  .bar__logo img { width: 44px; }
  .bar__nav { gap: 18px; }
  .bar__nav a { font-size: .75rem; }

  .box { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 104px var(--gutter) 88px; }
  .box__copy { padding: 0; order: 1; }
  .box h1 { font-size: clamp(3rem, 15vw, 4.25rem); }
  .box__sub { margin-top: 18px; }
  .box__photo { order: 2; margin-top: 40px; }
  .box__cue { bottom: 24px; }

  .inside { display: block; }
  .inside h2 { font-size: clamp(2.5rem, 12.5vw, 3.6rem); }
  .inside__main { width: 78%; margin: 48px 0 0 auto; }
  .inside__macro { width: 58%; margin: -28% 0 0; position: relative; }
  .inside__line { margin-top: 18px; }

  .pair { grid-template-columns: 1fr; padding: 0; }
  .pair img { height: auto; }

  .visit { display: block; }
  .visit__photo img { aspect-ratio: 4 / 5; }
  .visit__copy { margin-top: 44px; }
  .visit h2 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .lid, .js.is-open .lid { transform: scaleY(0); transition: none; }
  .js .box__photo img, .js .box__copy > *, .js .reveal {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}
