/* ============================================================
   BetaReal — portfolio
   One visual system: paper, ink, and restrained neutrals.
   Partner colour lives inside photography and screenshots only.
   ============================================================ */

:root{
  --paper:      #FBFAF8;
  --paper-2:    #F3F1ED;
  --paper-3:    #EAE7E1;
  --ink:        #12110F;
  --ink-2:      #3A3733;
  --muted:      #7A756D;
  --line:       rgba(18,17,15,.13);
  --line-soft:  rgba(18,17,15,.07);

  --serif: "Noto Serif Georgian", "Iowan Old Style", Georgia, serif;
  --sans:  "Noto Sans Georgian", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Background doodle strength. ~.03 is a whisper, ~.12 starts competing
     with body text. Tune here — it is the only place it is set. */
  --doodle: .085;

  --maxw: 1180px;
  --gut: clamp(24px, 6vw, 64px);
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html{ -webkit-text-size-adjust:100% }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.62;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

/* Doodle ground — deliberately faint. It is texture, not decoration. */
body::before{
  content:"";
  position:fixed; inset:0;
  background:url("../img/doodles.svg") repeat;
  background-size:560px 560px;
  opacity:var(--doodle);
  pointer-events:none;
  z-index:0;
}
body > *{ position:relative; z-index:1 }

img{ max-width:100%; display:block }
a{ color:inherit }

.wrap{
  width:100%; max-width:var(--maxw); margin-inline:auto;
  /* Never a `padding` shorthand on anything that also carries .wrap — it would
     reset these and drop the text onto the screen edge. Use padding-block. */
  padding-left:max(var(--gut), env(safe-area-inset-left));
  padding-right:max(var(--gut), env(safe-area-inset-right));
}

/* ---------- type ---------- */
h1,h2,h3{ font-family:var(--serif); font-weight:600; letter-spacing:-.015em; margin:0 }
h1{ font-size:clamp(2.4rem,6.2vw,4.4rem); line-height:1.06 }
h2{ font-size:clamp(1.9rem,4.2vw,3.1rem); line-height:1.12 }
h3{ font-size:clamp(1.15rem,2vw,1.4rem); line-height:1.25 }
p{ margin:0 0 1em }
.lede{ font-size:clamp(1.02rem,1.5vw,1.2rem); color:var(--ink-2); max-width:62ch }
.muted{ color:var(--muted) }

.eyebrow{
  font-family:var(--sans);
  font-size:.72rem; font-weight:700;
  letter-spacing:.18em; text-transform:uppercase;
  color:var(--muted);
  display:flex; align-items:center; gap:.7em;
}
.eyebrow::before{
  content:""; width:26px; height:1px; background:var(--ink); opacity:.45; flex:none;
}
.num{ font-family:var(--mono); font-size:.72rem; letter-spacing:.1em; color:var(--muted) }

/* ---------- header ---------- */
.hdr{
  position:sticky; top:0; z-index:60;
  background:color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter:saturate(160%) blur(14px);
  border-bottom:1px solid var(--line-soft);
}
.hdr .wrap{ display:flex; align-items:center; gap:24px; height:66px }
.brand{ display:flex; align-items:center; text-decoration:none; flex:none }
.brand img{ height:23px; width:auto; display:block }
@media (max-width:420px){ .brand img{ height:20px } }
.hdr nav{ margin-inline-start:auto; display:flex; align-items:center; gap:26px }
.hdr nav a{
  font-size:.86rem; text-decoration:none; color:var(--ink-2);
  transition:color .2s var(--ease);
}
.hdr nav a:hover{ color:var(--ink) }
@media (max-width:820px){ .hdr nav .hide-sm{ display:none } }

.btn{
  display:inline-flex; align-items:center; gap:.5em;
  font-family:var(--sans); font-size:.86rem; font-weight:600;
  padding:.62em 1.15em; border-radius:999px;
  border:1px solid var(--line); background:transparent; color:var(--ink);
  text-decoration:none; cursor:pointer; white-space:nowrap;
  transition:background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover{ border-color:var(--ink); background:var(--paper-2) }
.btn-solid{ background:var(--ink); color:var(--paper); border-color:var(--ink) }
.btn-solid:hover{ background:#000; color:var(--paper) }
.btn-sm{ font-size:.78rem; padding:.45em .9em }

/* ---------- intro ---------- */
.intro{
  padding-block:clamp(64px,11vw,132px) clamp(48px,7vw,84px);
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  column-gap:clamp(32px,5vw,72px); align-items:center;
}
.intro h1{
  margin:.5em 0 .38em;
  /* Sized to its half of the grid: the Georgian headline's longest word
     (დათვალიერება,) must fit the column, not run under the video. */
  font-size:clamp(2.1rem,3.5vw,3.5rem);
  overflow-wrap:break-word;
}
@media (max-width:900px){ .intro h1{ font-size:clamp(2.1rem,7.4vw,3.4rem) } }
.intro .meta{ grid-column:1 / -1 }
.intro-media{ margin:0 }
.intro-media video{
  display:block; width:100%; height:auto; aspect-ratio:848/478; object-fit:cover;
  border-radius:16px; border:1px solid var(--line-soft);
  background:var(--paper-3);
  box-shadow:0 24px 60px rgba(18,17,15,.12);
}
@media (max-width:900px){
  .intro{ grid-template-columns:1fr }
  .intro-media{ margin-top:28px }
}
.intro .meta{
  display:flex; flex-wrap:wrap; gap:10px 28px;
  margin-top:36px; padding-top:26px; border-top:1px solid var(--line-soft);
  font-family:var(--mono); font-size:.74rem; letter-spacing:.06em; color:var(--muted);
}

/* ---------- partner ---------- */
.partner{ padding-block:clamp(40px,7vw,80px) }

.band{
  position:relative;
  width:100vw; margin-inline:calc(50% - 50vw);
  aspect-ratio:1600/420;
  min-height:190px;
  overflow:hidden;
  background:var(--paper-3);
}
.band img{
  width:100%; height:100%;
  object-fit:cover; object-position:center center;
}
.band::after{
  content:""; position:absolute; inset:0;
  box-shadow:inset 0 0 0 1px var(--line-soft);
  pointer-events:none;
}

.partner-head{
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:18px 32px;
  padding-top:clamp(26px,4vw,44px);
}
.partner-head .who{ flex:1 1 320px; min-width:0 }
.partner-head h2{ margin-top:.34em }
.partner-head .kind{ color:var(--muted); font-size:.92rem; margin-top:.5em }

/* nudge */
.nudge{
  display:flex; align-items:center; gap:.65em;
  margin:clamp(30px,4.5vw,52px) 0 16px;
  font-size:.87rem; color:var(--ink-2);
}
.nudge svg{ flex:none; width:17px; height:17px; opacity:.62 }
.nudge b{ font-weight:700; color:var(--ink) }

/* ---------- conveyor ---------- */
/* A real scroll container, advanced by JS. Native overflow gives touch swipe
   and trackpad/wheel for free; app.js adds mouse drag and the auto-advance. */
.conveyor{
  position:relative;
  width:100vw; margin-inline:calc(50% - 50vw);
  padding-block:6px 10px;
  overflow-x:auto; overflow-y:hidden;
  overscroll-behavior-x:contain;
  scrollbar-width:none; -ms-overflow-style:none;
  cursor:grab;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent);
          mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent);
}
.conveyor::-webkit-scrollbar{ width:0; height:0; display:none }
.conveyor.is-drag{ cursor:grabbing }
.conveyor.is-drag .dish{ pointer-events:none }
.track{
  display:flex; gap:20px; width:max-content;
  padding-inline:var(--gut);
  will-change:transform;           /* sub-pixel remainder, see app.js */
}

.dish{
  flex:none; width:clamp(190px,23vw,254px);
  background:transparent; border:0; padding:0; margin:0;
  font:inherit; color:inherit; text-align:left; cursor:pointer;
  display:flex; flex-direction:column; gap:12px;
}
.dish .stage{
  position:relative;
  aspect-ratio:1;
  border-radius:14px;
  background:
    radial-gradient(64% 52% at 50% 58%, rgba(18,17,15,.055) 0%, transparent 68%),
    linear-gradient(170deg, #FFFFFF 0%, var(--paper-2) 100%);
  border:1px solid var(--line-soft);
  overflow:hidden;
  transition:border-color .3s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.dish .stage img{
  width:100%; height:100%; object-fit:contain;
  padding:7%;
  transition:transform .45s var(--ease);
}
.dish:hover .stage,
.dish:focus-visible .stage{
  border-color:var(--line);
  transform:translateY(-4px);
  box-shadow:0 14px 34px rgba(18,17,15,.09);
}
.dish:hover .stage img{ transform:scale(1.045) }

/* Live card: the 3D model sits exactly over the poster (same 7% inset as the
   image's padding, same camera) and fades in once loaded. It never takes
   pointer events, so drag and tap behave exactly as on the still card. */
.dish .stage model-viewer{
  position:absolute; inset:7%; width:auto; height:auto;
  background:transparent; --poster-color:transparent;
  pointer-events:none;
  opacity:0; transition:opacity .5s var(--ease), transform .45s var(--ease);
}
.dish .stage model-viewer::part(default-progress-bar){ display:none }
.dish .stage.is-live model-viewer{ opacity:1 }
.dish .stage.is-live img{ opacity:0; transition:opacity .5s var(--ease) }
.dish:hover .stage model-viewer{ transform:scale(1.045) }
.dish:focus-visible{ outline:none }
.dish:focus-visible .stage{ outline:2px solid var(--ink); outline-offset:3px }

.dish .tag{
  position:absolute; top:10px; left:10px;
  font-family:var(--mono); font-size:.6rem; letter-spacing:.12em;
  padding:.34em .6em; border-radius:999px;
  background:color-mix(in srgb, var(--paper) 86%, transparent);
  border:1px solid var(--line-soft); color:var(--ink-2);
  backdrop-filter:blur(6px);
}
.dish .label{ display:flex; align-items:baseline; justify-content:space-between; gap:10px }
.dish .label span{ font-size:.9rem; line-height:1.32 }
.dish .label i{
  font-style:normal; font-family:var(--mono); font-size:.66rem;
  color:var(--muted); opacity:0; transform:translateX(-4px);
  transition:opacity .25s var(--ease), transform .25s var(--ease);
}
.dish:hover .label i, .dish:focus-visible .label i{ opacity:1; transform:none }

/* Reduced motion: app.js skips the auto-advance. The belt stays scrollable
   by hand, and snapping makes that easier without any movement of its own. */
@media (prefers-reduced-motion:reduce){
  .conveyor{ scroll-snap-type:x proximity }
  .dish{ scroll-snap-align:center }
}

/* ---------- identity break ---------- */
.identity{
  padding-block:clamp(76px,12vw,150px);
  text-align:center;
  border-top:1px solid var(--line-soft);
  border-bottom:1px solid var(--line-soft);
  margin-top:clamp(40px,7vw,80px);
}
.identity .mark{
  height:clamp(38px,6.4vw,62px);
  width:auto;
  margin-inline:auto;
}
.identity p{ margin:1.3em auto 0; max-width:44ch; color:var(--muted); font-size:.97rem }

/* ---------- how ---------- */
.how{ padding-block:clamp(66px,10vw,120px) }
.how .head{ max-width:56ch }
.how h2{ margin:.5em 0 .4em }
.steps{
  display:grid; gap:20px;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  margin-top:clamp(36px,5vw,58px);
}
.step{
  border:1px solid var(--line-soft); border-radius:16px;
  background:linear-gradient(168deg,#fff, var(--paper-2));
  padding:24px 22px 26px;
  display:flex; flex-direction:column;
}
.step .shot{
  aspect-ratio:4/3; border-radius:10px; overflow:hidden;
  background:var(--paper-3); border:1px solid var(--line-soft);
  margin-bottom:20px;
}
.step .shot img{ width:100%; height:100%; object-fit:cover; object-position:center top }
.step h3{ margin:.5em 0 .45em }
.step p{ font-size:.92rem; color:var(--ink-2); margin:0 }

/* ---------- contact ---------- */
.contact{ padding-block:clamp(66px,10vw,120px); border-top:1px solid var(--line-soft) }
.contact h2{ margin:.5em 0 .45em; max-width:18ch }
.contact .actions{ display:flex; flex-wrap:wrap; gap:12px; margin-top:30px }
.contact .direct{
  margin-top:26px; font-family:var(--mono);
  font-size:.76rem; letter-spacing:.04em; color:var(--muted);
}
.contact .direct a{ text-decoration:none; border-bottom:1px solid var(--line) }

/* ---------- footer ---------- */
footer{ border-top:1px solid var(--line-soft); padding-block:40px 56px }
footer .wrap{ display:flex; flex-wrap:wrap; gap:14px 28px; align-items:center }
footer small{ color:var(--muted); font-size:.78rem }
footer .sp{ margin-inline-start:auto }

/* ---------- modal ---------- */
.modal[hidden]{ display:none !important }
.modal{
  position:fixed; inset:0; z-index:100;
  display:grid; place-items:center;
  padding:clamp(14px,3vw,36px);
  background:color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter:blur(16px) saturate(150%);
  animation:fade .24s var(--ease);
}
@keyframes fade{ from{ opacity:0 } }
.sheet{
  position:relative;
  width:min(760px,100%);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 30px 80px rgba(18,17,15,.16);
  overflow:hidden;
  display:flex; flex-direction:column;
  max-height:100%;
}
.sheet header{
  display:flex; align-items:center; gap:14px;
  padding:16px 18px; border-bottom:1px solid var(--line-soft);
}
.sheet header .t{ min-width:0 }
.sheet header h3{ font-size:1.05rem; line-height:1.25 }
.sheet header .s{ font-size:.76rem; color:var(--muted); margin-top:2px }
.sheet header .x{
  margin-inline-start:auto; flex:none;
  width:36px; height:36px; border-radius:50%;
  border:1px solid var(--line); background:transparent; color:var(--ink);
  cursor:pointer; font-size:19px; line-height:1;
  display:grid; place-items:center;
  transition:background .2s var(--ease), border-color .2s var(--ease);
}
.sheet header .x:hover{ background:var(--paper-2); border-color:var(--ink) }
.sheet .viewer{
  aspect-ratio:1; width:100%; min-height:0;
  background:
    radial-gradient(62% 48% at 50% 56%, rgba(18,17,15,.05) 0%, transparent 70%),
    linear-gradient(175deg,#fff, var(--paper-2));
}
.sheet model-viewer{ width:100%; height:100%; --poster-color:transparent; background:transparent }
/* Models run 3–13MB; keep feedback, just make it quiet. */
.sheet model-viewer::part(default-progress-bar){
  height:2px; background:var(--ink); opacity:.75;
}
.sheet footer{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:14px 18px; border-top:1px solid var(--line-soft); border-bottom:0;
}
.sheet footer .hint{ font-size:.78rem; color:var(--muted) }
.sheet footer .sp{ margin-inline-start:auto }

@media (max-width:560px){
  .sheet .viewer{ aspect-ratio:4/3 }
}
