/* Tintame · framing-workshop world. Mat board, bevel, pencil. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Reenie Beanie";
  src: url("/fonts/reenie-beanie-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

:root {
  /* boards */
  --terracotta: #c8714f;
  --terracotta-deep: #a24b36;
  --cobalt: #3557a0;
  --ochre: #d9a441;
  --sage: #93aa8c;
  --bone: #f4eee4;
  /* inks, one per board, tinted from the board hue */
  --ink-terracotta: #2e120b;
  --ink-cobalt: #f6f1e8;
  --ink-ochre: #2b1a05;
  --ink-sage: #172414;
  --ink-bone: #231612;
  /* bevel faces: light from the top left */
  --bevel-top: #e7ded0;
  --bevel-left: #eee7db;
  --bevel-right: #faf6ef;
  --bevel-bottom: #fdfbf7;
  --pencil: rgba(38, 20, 14, .82);

  --gutter: clamp(16px, 8.5vw, 140px);
  --bevel: clamp(7px, .85vw, 13px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-press: cubic-bezier(.32, .72, 0, 1);

  --f-sans: "Familjen Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-pencil: "Reenie Beanie", "Bradley Hand", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--terracotta-deep) var(--bone); }
body {
  margin: 0;
  background: var(--terracotta);
  color: var(--ink-terracotta);
  font-family: var(--f-sans);
  font-size: clamp(1rem, .94rem + .28vw, 1.1875rem);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  caret-color: currentColor;
}
::selection { background: var(--cobalt); color: var(--ink-cobalt); }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.sr-only, .sr-defs { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 30; background: var(--bone); color: var(--ink-bone); padding: .5em .9em; border-radius: 4px; }
.skip:focus { top: 12px; }

/* ---------- boards ---------- */
.board { position: relative; isolation: isolate; }
.board::after { /* paper grain */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("/assets/img/grain.png") 0 0 / 256px 256px; opacity: .55; mix-blend-mode: multiply;
}
.board--terracotta { background: var(--terracotta); color: var(--ink-terracotta); }
.board--terracotta-deep { background: var(--terracotta-deep); color: #fbe9df; }
.board--cobalt { background: var(--cobalt); color: var(--ink-cobalt); }
.board--ochre { background: var(--ochre); color: var(--ink-ochre); }
[data-board="sage"] { --board: var(--sage); --ink: var(--ink-sage); }
[data-board="bone"] { --board: var(--bone); --ink: var(--ink-bone); }
[data-board="ochre"] { --board: var(--ochre); --ink: var(--ink-ochre); }

/* ---------- type ---------- */
.display {
  font-size: clamp(2.5rem, 1.2rem + 4.2vw, 5.1rem);
  line-height: .98; letter-spacing: -.035em; font-weight: 700; margin: 0 0 .42em;
  text-wrap: balance;
  /* debossed into the board */
  text-shadow: 0 1px 0 rgba(255, 226, 205, .28), 0 -1px 0 rgba(60, 20, 10, .18);
}
.h2 {
  font-size: clamp(2rem, 1.1rem + 3vw, 3.9rem); line-height: 1; letter-spacing: -.03em; font-weight: 700;
  margin: 0 0 .5em; text-wrap: balance;
}
.lede { font-size: clamp(1.06rem, .95rem + .45vw, 1.3rem); line-height: 1.45; max-width: 31ch; margin: 0 0 1.6em; }
.body { max-width: 44ch; margin: 0; }
.pencil { font-family: var(--f-pencil); font-size: 1.7em; line-height: 1; letter-spacing: .01em; color: var(--pencil); }

/* ---------- nav ---------- */
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: clamp(18px, 2.6vw, 34px) var(--gutter);
}
.wordmark { font-weight: 700; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem); letter-spacing: -.045em; text-decoration: none; line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 226, 205, .3), 0 -1px 0 rgba(60, 20, 10, .2); }
.wordmark--small { font-size: 1.4rem; text-shadow: none; }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: clamp(1.2rem, 2.6vw, 2.6rem); list-style: none; margin: 0; padding: 0; }
.nav nav a { text-decoration: none; font-size: 1.02rem; position: relative; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.3em; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out); }
.nav nav a:hover::after, .nav nav a:focus-visible::after { transform: scaleX(1); }
.nav .btn { margin-left: clamp(1rem, 3vw, 3.5rem); }

/* ---------- buttons & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 500; font-size: 1rem; line-height: 1; white-space: nowrap;
  padding: .95em 1.25em; border-radius: 4px; cursor: pointer; text-decoration: none;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), transform .2s var(--ease-press), box-shadow .3s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--outline { border: 1.5px solid currentColor; background: transparent; color: inherit; padding: .75em 1.1em; }
.btn--outline:hover { background: var(--ink-terracotta); color: var(--terracotta); }
.btn--solid { border: 0; background: var(--terracotta-deep); color: #fff5ee; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(60,20,10,.25); }
.btn--solid:hover { background: #8e3f2c; }
.btn[disabled] { opacity: .6; cursor: progress; }

.signup { display: grid; grid-template-columns: 1fr auto; max-width: 30rem; position: relative; }
.signup input[type="email"] {
  font: inherit; font-size: 1.02rem; color: inherit; min-width: 0;
  padding: .92em 1em; border: 1.5px solid var(--ink-terracotta); border-right: 0; border-radius: 4px 0 0 4px;
  background: rgba(255, 240, 230, .12);
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.signup input::placeholder { color: #3a160c; opacity: 1; }
.signup input:focus { outline: none; background: rgba(255, 240, 230, .28); }
.signup:focus-within { outline: 2px solid var(--ink-terracotta); outline-offset: 3px; border-radius: 5px; }
.signup .btn { border-radius: 0 4px 4px 0; }
.signup__msg { grid-column: 1 / -1; margin: .7em 0 0; min-height: 1.4em; font-size: .95rem; }
.signup.is-error input { border-color: #5c0f05; background: rgba(92, 15, 5, .08); }
.signup.is-done input, .signup.is-done .btn { display: none; }
.signup.is-done .signup__msg { font-size: 1.15rem; font-weight: 500; margin: 0; }

/* ---------- the window (bevel cut) ---------- */
.window { margin: 0; position: relative; }
.window__cut {
  position: relative; overflow: hidden;
  border: var(--bevel) solid; border-color: var(--bevel-top) var(--bevel-right) var(--bevel-bottom) var(--bevel-left);
  background: #b98d6d;
}
.window__cut > img, .window__cut > video { width: 100%; height: 100%; object-fit: cover; }
.window__cut::before { /* the cut edge throws a thin shadow onto the picture below the top bevel */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  box-shadow: inset 0 6px 8px -6px rgba(40, 18, 8, .45), inset 5px 0 8px -7px rgba(40, 18, 8, .3);
}

/* pencil dimension lines */
.dim { position: absolute; font-family: var(--f-pencil); color: var(--pencil); font-size: clamp(1.45rem, 1rem + 1vw, 2.1rem); line-height: 1; pointer-events: none; }
.dim--top { left: 0; right: 0; bottom: calc(100% + 12px); height: 14px;
  background:
    linear-gradient(var(--pencil), var(--pencil)) 0 50% / 100% 1px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 7' preserveAspectRatio='none'%3E%3Cpath d='M.5 0V7' vector-effect='non-scaling-stroke' stroke-width='1' stroke='%23261410' stroke-opacity='.82'/%3E%3C/svg%3E") 0 100% / 10% 7px repeat-x;
  border-inline: 1px solid var(--pencil);
}
.dim--top span { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -2px); }
.dim--side { top: 0; bottom: 0; right: calc(100% + 12px); width: 14px;
  background:
    linear-gradient(var(--pencil), var(--pencil)) 50% 0 / 1px 100% no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 10' preserveAspectRatio='none'%3E%3Cpath d='M0 .5H7' vector-effect='non-scaling-stroke' stroke-width='1' stroke='%23261410' stroke-opacity='.82'/%3E%3C/svg%3E") 100% 0 / 7px 10% repeat-y;
  border-block: 1px solid var(--pencil);
}
.dim--side span { position: absolute; top: 50%; right: 100%; transform: translate(-4px, -50%) rotate(-90deg); transform-origin: right center; white-space: nowrap; }

/* ---------- fit: hero + pinned sequence ---------- */
.fit { height: 560vh; }
.fit__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.fit__copy { position: absolute; left: var(--gutter); top: 0; bottom: 0; width: min(30vw, 34rem); display: flex; align-items: center; }
.fit__intro { padding-top: 4vh; }
.fit__steps { position: absolute; inset: auto 0 auto 0; top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; }
.step { position: absolute; left: 0; right: 0; max-width: 26vw; top: 0; transform: translateY(-50%); opacity: 0; visibility: hidden; }
.step h2 { font-size: clamp(1.8rem, 1rem + 1.9vw, 3rem); line-height: 1; letter-spacing: -.03em; margin: .1em 0 .4em; font-weight: 700; text-wrap: balance; }
.step p { margin: 0 0 .4em; max-width: 30ch; }
.step__n { font-family: var(--f-pencil); font-size: 2.6rem; line-height: 1; color: var(--pencil); }
.step__caption { font-weight: 600; }
.step__sizes { font-variant-numeric: tabular-nums; font-size: 1.15em; }
.step__rule { font-family: var(--f-pencil); font-size: 1.85rem; line-height: 1.1; color: var(--pencil); }

.fit__window { position: absolute; left: 47%; top: 24%; width: 44%; }
.fit__window .window__cut { aspect-ratio: 1614 / 1076; }
.measure { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; fill: none; stroke: #fbf3e6; stroke-width: 3; vector-effect: non-scaling-stroke; }
.measure path { vector-effect: non-scaling-stroke; stroke-width: 1.6; }
.measure g { opacity: 0; }
.measure__labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ml { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); font-family: var(--f-pencil); font-size: clamp(1.35rem, .9rem + 1vw, 2.1rem); color: #fff8ee; opacity: 0; white-space: nowrap; text-shadow: 0 1px 2px rgba(40, 18, 8, .35); }
.ml--eye { transform: translate(0, -110%); }

.hang { position: absolute; inset: 0; z-index: 2; }
.hang__piece { position: absolute; opacity: 0; transform-origin: 50% 0; }
.hang__piece .frame { width: 100%; height: 100%; padding: 5%; background: #fbf8f2; border: max(2px, .35vw) solid #1d1714; box-shadow: 0 .5vw 1.2vw rgba(35, 15, 6, .32), 0 .1vw .2vw rgba(35, 15, 6, .25); }
.hang__piece .frame--oak { border-color: #b98a55; }
.hang__piece img { width: 100%; height: 100%; object-fit: cover; }

/* scroll cue: a pencil note on the board */
.fit__cue { position: absolute; left: var(--gutter); bottom: clamp(20px, 4vh, 40px); margin: 0; font-size: 2rem; }

/* ---------- rooms ---------- */
.rooms { padding: clamp(96px, 14vh, 180px) var(--gutter) clamp(96px, 16vh, 200px); }
.rooms__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem 4rem; align-items: end; margin-bottom: clamp(48px, 8vh, 96px); }
.rooms__row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 40px); align-items: start; }
.room { margin: 0; background: var(--board); color: var(--ink); padding: clamp(18px, 2.4vw, 40px); position: relative;
  box-shadow: 0 18px 40px -18px rgba(8, 18, 45, .55), 0 2px 4px rgba(8, 18, 45, .2); }
.room::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: url("/assets/img/grain.png") 0 0 / 256px 256px; opacity: .45; mix-blend-mode: multiply; }
.room:nth-child(1) { grid-column: 1 / span 7; grid-row: 1 / span 2; }
.room:nth-child(2) { grid-column: 8 / span 5; grid-row: 1; margin-top: clamp(40px, 8vh, 100px); }
.room:nth-child(3) { grid-column: 3 / span 6; grid-row: 3; margin-top: calc(-1 * clamp(20px, 6vh, 80px)); z-index: 1; }
.room:nth-child(2) + .room { }
.room .window__cut { aspect-ratio: 16 / 9; background: #cfc3b2; }
.room figcaption { margin-top: 1em; font-size: .98rem; display: flex; gap: .7em; align-items: baseline; flex-wrap: wrap; }
.room figcaption .pencil { color: rgba(0, 0, 0, .62); }

/* ---------- collection ---------- */
.collection { padding: clamp(96px, 14vh, 180px) var(--gutter) clamp(80px, 12vh, 160px); overflow: hidden; }
.collection__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem 4rem; align-items: end; margin-bottom: clamp(56px, 9vh, 110px); }
.rail { --k: 3px; position: relative; display: flex; align-items: flex-start; gap: calc(10 * var(--k)); padding-top: 26px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 12px; }
.rail__line { position: absolute; left: 0; right: 0; top: 10px; height: 1px; background: var(--pencil); }
.print { margin: 0; flex: none; width: calc(var(--w) * var(--k)); position: relative; }
.print::before { content: ""; position: absolute; left: 50%; top: -16px; width: 1px; height: 16px; background: var(--pencil); }
.print__frame { height: calc(var(--h) * var(--k)); background: #fbf8f2; padding: 7%; border: 3px solid #1d1714;
  box-shadow: 0 16px 28px -14px rgba(60, 35, 0, .55), 0 2px 3px rgba(60, 35, 0, .3);
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); }
.print:hover .print__frame { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 26px 36px -16px rgba(60, 35, 0, .55), 0 2px 3px rgba(60, 35, 0, .3); }
.print img { width: 100%; height: 100%; object-fit: cover; }
.print figcaption { display: grid; gap: .2em; }
.print__credit { font-family: var(--f-sans); font-size: .78rem; line-height: 1.3; color: var(--ink-ochre); min-width: 9rem; max-width: 16rem; }
.print figcaption { margin-top: .45em; }
.print figcaption .pencil { font-size: 1.75rem; }
.scale-note { margin: 1.6rem 0 0; font-size: 1.9rem; }

/* ---------- close ---------- */
.close { min-height: 92vh; display: grid; place-items: center; padding: clamp(80px, 12vh, 160px) var(--gutter); }
.window--form { width: min(100%, 60rem); }
.window__cut--core { background: var(--bone); color: var(--ink-bone); padding: clamp(40px, 7vw, 110px) clamp(24px, 6vw, 96px); text-align: left; }
.window__cut--core::before { box-shadow: inset 0 8px 10px -8px rgba(40, 18, 8, .35), inset 6px 0 10px -8px rgba(40, 18, 8, .25); }
.window__cut--core .body { margin-bottom: 2rem; }
.signup--close input[type="email"] { border-color: var(--ink-bone); background: #fff; }
.signup--close input::placeholder { color: rgba(35, 22, 18, .6); }
.signup--close:focus-within { outline-color: var(--ink-bone); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; align-items: baseline; padding: 40px var(--gutter) 48px; font-size: .95rem; }
.foot p { margin: 0; max-width: 46ch; opacity: .9; }
.foot__credits { flex-basis: 100%; order: 5; font-size: .82rem; max-width: 90ch !important; }
.foot a { margin-left: auto; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; padding: .6em .8em; font-size: .9rem; }
  .fit { height: 520vh; }
  .fit__copy { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: 0; height: 58%; align-items: flex-start; }
  .fit__intro { padding-top: 0; }
  .fit__window { left: var(--gutter); width: calc(100% - 2 * var(--gutter)); top: 12%; }
  .dim--side { display: none; }
  .fit__steps { top: 8%; transform: none; }
  .step { transform: none; max-width: none; }
  .fit__cue { display: none; }
  .display { font-size: clamp(2.3rem, 9.6vw, 3rem); }
  .lede { font-size: 1.02rem; margin-bottom: 1.1em; }
  .signup { grid-template-columns: 1fr; }
  .signup input[type="email"] { border-right: 1.5px solid; border-radius: 4px; }
  .signup .btn { border-radius: 4px; margin-top: 8px; }
  .rooms__head, .collection__head { grid-template-columns: 1fr; }
  .room:nth-child(n) { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }
  .rail { --k: 2px; }
  .foot a { margin-left: 0; }
}

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