/* design.teto.io
   Rules: white background, sans serif, lots of space, no shadows.
   The only shadow-like effect is the 1px unblurred inset edge on screens (.frame::after). */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #6b6b6b;
  --slot: #ededed;
  --tile: #f2f2f2;
  --hover: #f2f2f2;
  --line: #ededed;
  --edge: rgba(0, 0, 0, 0.08);
  --wrap: 1120px;
  --gutter: max(16px, calc((100% - var(--wrap)) / 2));
  --shot-h: clamp(200px, 44vw, 400px);
  --fade: clamp(28px, 6vw, 96px);
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  /* Spring ease. Older browsers fall back to an overshooting cubic-bezier. */
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.08);
  --t-reveal: 1.2s;
  --stagger: 80ms;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.1%, 1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html.ov-open, html.ov-open body { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Reveal: blur-in + scale-in on a spring, staggered with --i */
.js .reveal {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(18px) scale(0.94);
  transition:
    opacity calc(var(--t-reveal) * 0.6) ease-out,
    filter calc(var(--t-reveal) * 0.7) ease-out,
    transform var(--t-reveal) var(--spring);
  transition-delay: calc(var(--i, 0) * var(--stagger));
  will-change: opacity, filter, transform;
}
.js .reveal.in { opacity: 1; filter: blur(0); transform: none; }
.js .reveal.done { will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { filter: none; transform: none; transition: opacity 0.4s ease-out; transition-delay: 0s; }
}

/* Intro */
.intro {
  padding: clamp(160px, 26vh, 260px) 16px clamp(140px, 22vh, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.intro h1 { font-size: clamp(40px, 7vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.lede { max-width: 520px; font-size: 17px; color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }

.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.ico:hover { background: var(--hover); color: var(--ink); }
.ico svg { width: 20px; height: 20px; }
.ico.sm svg { width: 18px; height: 18px; }

/* Projects */
.projects { display: flex; flex-direction: column; gap: clamp(200px, 30vh, 320px); padding-bottom: clamp(200px, 30vh, 320px); }
.project { display: flex; flex-direction: column; gap: 36px; }
.p-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 0 16px; }
.p-meta { font-size: 13px; color: var(--ink-3); }
.p-name {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em;
}
.p-name:hover { color: var(--ink-2); }
.p-tag { max-width: 480px; font-size: 15px; color: var(--ink-2); }
.p-links { display: flex; gap: 2px; align-items: center; }

/* Horizontal screenshot row: gesture / trackpad / drag, no visible scrollbar */
.strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  /* --lead / --trail center the first and last screen (set in app.js) */
  padding: 4px var(--trail, var(--gutter)) 4px var(--lead, var(--gutter));
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }

/* Blurred, faded edges hint that a row scrolls sideways */
.strip-wrap { position: relative; }
.strip-wrap::before,
.strip-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--fade);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  clip-path: inset(0);
}
.strip-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, var(--bg) 12%, rgba(255, 255, 255, 0.8) 55%, rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(to right, #000 55%, transparent);
  mask-image: linear-gradient(to right, #000 55%, transparent);
}
.strip-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, var(--bg) 12%, rgba(255, 255, 255, 0.8) 55%, rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(to left, #000 55%, transparent);
  mask-image: linear-gradient(to left, #000 55%, transparent);
}
.strip-wrap.more-left::before,
.strip-wrap.more-right::after { opacity: 1; }
.strip.dragging { cursor: grabbing; }
.strip.dragging * { pointer-events: none; }

.shot {
  flex: 0 0 auto;
  height: var(--shot-h);
  aspect-ratio: 16 / 10;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
}
.shot.mobile { aspect-ratio: 390 / 844; }
.shot .frame { width: 100%; height: 100%; }
.shot:hover .frame img { transform: scale(1.015); }

/* A screen: image or grey slot, with the 1px inset edge drawn on top */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--slot);
  isolation: isolate;
}
.frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--edge);
  pointer-events: none;
  z-index: 2;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--spring);
  user-select: none;
  -webkit-user-drag: none;
}
.frame.contain { background: #f7f7f7; }
.frame.contain img { object-fit: contain; object-position: center; padding: 18px; }
.slot-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  right: 16px;
  font-size: 12px;
  color: #595959;
  text-align: left;
}
.frame.has-img .slot-label { display: none; }

.no-shots {
  margin: 0 auto;
  padding: 0 16px;
  font-size: 13px;
  color: var(--ink-3);
}

.foot { padding: 0 16px 120px; display: flex; justify-content: center; }
.foot p { font-size: 13px; color: var(--ink-3); }
.noscript { text-align: center; color: var(--ink-2); padding: 40px 16px; }

/* Project overlay: a full page on top of the main page */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.overlay[hidden] { display: none; }
.overlay:focus { outline: none; }
.overlay.show { opacity: 1; }
.overlay-inner { min-height: 100%; }

.ov-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px var(--gutter);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.ov-crumb { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ov-close {
  width: 44px;
  height: 44px;
  border: 1px solid #e0e0e0;
  border-radius: 22px;
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.ov-close:hover { background: var(--hover); }
.ov-close svg { width: 18px; height: 18px; }

.wrap { max-width: calc(var(--wrap) + 32px); margin: 0 auto; padding: 0 16px; }
.ov-head { padding: clamp(120px, 18vh, 180px) 0 clamp(80px, 12vh, 120px); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.ov-head h1 { font-size: clamp(40px, 7vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.ov-head .lede { max-width: 560px; }
.ov-hero { aspect-ratio: 16 / 9; }

.label { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

.ov-info { padding-top: clamp(120px, 20vh, 200px); display: flex; flex-wrap: wrap; gap: 80px; }
.ov-about { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ov-about p { font-size: 20px; line-height: 1.55; }
.stats { margin-top: 16px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.stats li { display: flex; flex-direction: column; gap: 4px; }
.stats .v { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stats .k { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.ov-facts { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 48px; }
.facts { display: flex; flex-direction: column; gap: 12px; }
.facts dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); row-gap: 12px; column-gap: 16px; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts a { text-underline-offset: 3px; text-decoration-color: rgba(0, 0, 0, 0.25); }
.facts a:hover { text-decoration-color: currentColor; }

.ov-ui { padding-top: clamp(140px, 22vh, 220px); display: flex; flex-direction: column; gap: 32px; }
.ov-ui .label { padding: 0 var(--gutter); }
.ov-ui .shot { --shot-h: clamp(260px, 48vw, 440px); cursor: zoom-in; }

.ov-assets { padding-top: clamp(140px, 22vh, 220px); display: flex; flex-direction: column; gap: 32px; }
.ov-assets .note { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.pair { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 100px; }
.pair-screen { flex: 2 1 420px; min-width: 0; aspect-ratio: 16 / 10; }
.pair-assets { flex: 1 1 260px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-content: start; }
.pair-assets figure { display: flex; flex-direction: column; gap: 8px; }
.pair-assets .frame { aspect-ratio: 1 / 1; }
.pair-assets figure.wide { grid-column: 1 / -1; }
.pair-assets figure.wide .frame { aspect-ratio: 1200 / 630; }
.pair-assets figure.wide .frame img { padding: 0; object-fit: cover; }
.pair-assets figcaption { font-size: 12px; color: var(--ink-2); }

.ov-nav { margin-top: 120px; margin-bottom: 160px; border-top: 1px solid var(--line); padding-top: 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.navlink { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; min-height: 44px; }
.navlink.next { text-align: right; align-items: flex-end; margin-left: auto; }
.navlink .k { font-size: 13px; color: var(--ink-3); }
.navlink .n { font-size: 20px; font-weight: 600; transition: color 0.2s; }
.navlink:hover .n { color: var(--ink-2); }

/* Lightbox for a single screen inside the overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 24px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
.lightbox.show { opacity: 1; }
.lightbox .frame { max-width: min(1400px, 100%); max-height: 100%; background: none; }
.lightbox .frame img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain; }
.lightbox .ov-close { position: absolute; top: 12px; right: 16px; }

@media (max-width: 640px) {
  :root { --shot-h: 48vw; }
  .strip { gap: 12px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .stats .v { font-size: 22px; }
  .ov-about p { font-size: 18px; }
  .ov-info { gap: 64px; }
  .p-name { font-size: 28px; }

  /* Project page on phones: the screens become a grid of grey tiles */
  .ov-ui .strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 12px;
    overflow: visible;
    padding: 0 16px;
    cursor: auto;
  }
  .ov-ui .strip-wrap::before,
  .ov-ui .strip-wrap::after { display: none; }
  .ov-ui .shot,
  .ov-ui .shot.mobile {
    width: auto;
    height: auto;
    aspect-ratio: 3 / 4;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--tile);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ov-ui .shot.desktop { grid-column: 1 / -1; aspect-ratio: 16 / 11; padding: 16px; }
  .ov-ui .shot .frame { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 8px; }
  .ov-ui .shot.mobile .frame { width: auto; height: 100%; aspect-ratio: 390 / 844; }
}
