/* ==========================================================
   Droplab Studio — styles
   Light, minimal, technical. Edit the tokens below to re-theme.
   ========================================================== */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --mid: #8c8c8c;
  --faint: #cccccc;
  --line: rgba(17, 17, 17, 0.1);
  --chip: #ededed;
  --chip-hover: #e0e0e0;

  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.7);

  --pad: clamp(12px, 1.6vw, 20px);
  --gap: clamp(12px, 1.6vw, 20px);

  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 6px 10px; }
.skip:focus { left: 8px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  background: var(--chip);
  border: 0; border-radius: 3px;
  font-size: 12px; line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.chip:hover { background: var(--chip-hover); }
.chip--dark { background: var(--ink); color: var(--bg); }
.chip--dark:hover { background: #333; }
.chip--lg { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- Header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  align-items: center;
  padding: var(--pad);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .35s var(--ease);
}
.top.is-scrolled::before { opacity: 1; }
.top__brand {
  grid-column: 1 / span 6; justify-self: start;
  line-height: 0;
}
.top__brand a { display: flex; align-items: center; gap: 12px; }
.top__name { font-size: 13px; line-height: 1; color: var(--ink); white-space: nowrap; text-transform: none; }
.top__brand img { display: block; height: 30px; width: auto; }
.top__nav { grid-column: 7 / -1; display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- Hero index ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--pad) + 1.18em + clamp(40px, 9vh, 110px)) var(--pad) var(--pad);
  display: flex; flex-direction: column;
  --rule: #8c8c8c;
  --text: #7a7a7a;
  font-family: var(--mono);
  font-size: clamp(14px, 1.45vw, 21px);
  line-height: 1.18;
  text-transform: uppercase;
}

.rows { display: grid; }
.irow {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gap);
  padding: 12px 0 clamp(22px, 4vh, 40px);
  color: var(--text);
}
.irow::before, .irow::after {
  content: ""; position: absolute; left: 0; top: 0;
  background: var(--rule);
  transform-origin: left center;
}
.irow::before { right: 0; height: 1px; }
.irow::after { width: calc((100% - 11 * var(--gap)) / 12 + var(--gap) + 2em); height: 4px; top: -2px; background: var(--ink); }
.irow__label { grid-column: 1 / span 5; justify-self: start; }
.irow__items { grid-column: 7 / -1; list-style: none; margin: 0; padding: 0; }
.irow__items button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-transform: inherit; color: inherit; letter-spacing: inherit; }
.irow a, .irow button { transition: color .2s; }
.irow a:hover, .irow button:hover { color: var(--ink); }

/* ---------- Intro sequence ----------
   Pure CSS on one clock from the first frame, so the order can't drift:
   0.20s–1.21s  row rules draw left → right (one every 0.093s, 0.733s each)
   1.28s–1.75s  all hero text fades in
   1.80s–2.27s  everything below the hero fades in
   "both" keeps each element hidden until its turn. */
@keyframes intro-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }

.sweep { display: inline-block; }
.hero .irow::before { animation: intro-draw .733s linear var(--ld) both; }
.hero .irow::after { animation: intro-draw .2s linear var(--ld) both; }
.hero .irow:nth-child(1) { --ld: .2s; }
.hero .irow:nth-child(2) { --ld: .293s; }
.hero .irow:nth-child(3) { --ld: .387s; }
.hero .irow:nth-child(4) { --ld: .48s; }
.hero .sweep { animation: intro-fade .467s linear 1.28s both; }
main > section:not(.hero), .foot { animation: intro-fade .467s linear 1.8s both; }

/* deep links to a section (like /#work) skip the wait; set in <head> */
.skip-intro main > section:not(.hero), .skip-intro .foot { animation: none; }


/* ---------- Shared section bits ---------- */
main > section { padding: clamp(80px, 14vh, 160px) var(--pad) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-label {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 8px 0; margin-bottom: clamp(24px, 4vh, 40px);
  border-top: 1px solid var(--ink);
}
.row-label h2 { font-size: inherit; }
.row-label span { color: var(--mid); }
.row-label--soft { border-top-color: var(--mid); color: var(--mid); }

/* ---------- Focus ---------- */
.focus__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.focus__item { grid-column: span 4; display: grid; gap: 10px; align-content: start; }
.focus__item h3 { color: var(--ink); }
.focus__item p { color: #555; max-width: 38ch; }

/* ---------- Work ---------- */
.work__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px var(--gap); }
/* collapsed: one row of three; "View all" opens the rest (no JS: everything shows) */
.js .work:not(.is-open) .project:nth-child(n+4) { display: none; }
.work__more { margin-top: 40px; }

.project__frame {
  display: block; overflow: hidden;
  background: #ededed;
  aspect-ratio: 16 / 9;
}
.project__frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 1.2s var(--ease);
}
.project__frame:hover img { transform: scale(1.025); }

.info { display: grid; gap: 4px; margin-top: 12px; }
.info__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--gap); }
.info__row > :first-child { color: var(--mid); }
.info__head > :first-child { color: var(--ink); }
.info__row a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; justify-self: start; }
.info__row a:hover { text-decoration: none; }
.info__note { margin-top: 6px; font-size: 13px; color: #555; }
.info__note > :last-child { max-width: 52ch; }

/* ---------- Studio ---------- */
.statement {
  font-size: clamp(24px, 3.1vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 22ch;
}

/* statement sticks under the header brand so it reads "Droplab Studio / is a digital lab…",
   while the services scroll past on the right (like the Work section) */
.about__split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.about__lead { grid-column: 1 / span 7; }
.about__lead .statement { position: sticky; top: 72px; }
/* desktop: stays hidden until it reaches its pinned spot under the header brand, then slides in */
@media (min-width: 901px) {
  /* faint until it pins, then fades to full ink */
  .js .about__lead .statement { color: #e4e4e4; transition: color .6s var(--ease); }
  .js .about__lead .statement.is-pinned { color: var(--ink); }
}
.statement__brand { display: none; }
.about__services {
  grid-column: 9 / -1; list-style: none; margin: 0; padding: 22vh 0 8vh;
  display: grid; gap: clamp(48px, 9vh, 96px); align-content: start;
}
.svc { display: grid; gap: 4px; }

/* ---------- Words ---------- */
.words__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.words blockquote { font-size: 15px; line-height: 1.4; letter-spacing: -0.01em; max-width: 40ch; }
.words figcaption { margin-top: 14px; color: var(--mid); }

/* ---------- FAQ ---------- */
.faq__list { display: grid; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: baseline;
  padding: 10px 0;
  font-size: 15px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-family: var(--mono); color: var(--mid); }
.faq details[open] summary::after { content: "–"; }
.faq__n { color: var(--ink); grid-column: 1 / span 3; }
.faq__q { grid-column: 4 / -1; padding-right: 30px; }
.faq summary:hover { color: #000; }
.faq details p {
  margin-left: calc((100% - 11 * var(--gap)) / 12 * 3 + 3 * var(--gap));
  padding: 0 0 18px; max-width: 64ch; color: #555;
}

/* ---------- Contact ---------- */
.contact__lead { color: var(--mid); font-size: 15px; }
.contact__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; margin-top: 18px; }
.contact__msg { display: grid; gap: 6px; justify-items: start; }
.contact__note { font-size: 12px; color: var(--mid); }
.contact__mail { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.contact__mail span { color: var(--mid); }
.contact__mail a { text-transform: none; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.contact__mail a:hover { text-decoration: none; }

/* ---------- Footer ---------- */
.foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
  padding: clamp(100px, 18vh, 200px) var(--pad) var(--pad);
  color: var(--mid);
}
.foot a { justify-self: end; }
.foot a:hover { color: var(--ink); }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 1px 2px rgba(17,17,17,.06),
    0 24px 60px -24px rgba(17,17,17,.28);
}

.dock { position: fixed; right: var(--pad); bottom: var(--pad); z-index: 45; transition: opacity .3s, transform .3s var(--ease); }
.dock.is-hidden, .js .dock.is-away { opacity: 0; transform: translateY(10px); pointer-events: none; }
.dock__btn {
  height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.dock__btn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #111111; box-shadow: 0 0 0 3px rgba(17,17,17,.12); }

.panel {
  position: fixed; right: var(--pad); bottom: var(--pad); z-index: 50;
  width: min(360px, calc(100vw - var(--pad) * 2));
  max-height: calc(100svh - var(--pad) * 2 - 40px);
  overflow: auto;
  border-radius: 12px;
  padding: 14px;
  transform-origin: bottom right;
  animation: panel-in .45s var(--ease);
}
.panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; }
.panel__head h2 { font-size: 18px; letter-spacing: -0.02em; }
.panel__close { background: none; border: 0; cursor: pointer; color: var(--mid); padding: 0; }
.panel__close:hover { color: var(--ink); }
.panel__sub { color: var(--mid); margin: 6px 0 14px; text-transform: none; }

.form { display: grid; gap: 8px; }
.form label { display: grid; gap: 4px; }
.form label > span, .form legend { color: var(--mid); }
.form fieldset { border: 0; margin: 0; padding: 0; }
.form legend { padding: 0; margin-bottom: 4px; }
.form input[type="text"], .form input[type="email"], .form textarea {
  width: 100%;
  font: 400 14px/1.3 var(--font); color: var(--ink);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 6px;
  padding: 8px 10px;
}
.form textarea { resize: vertical; min-height: 80px; }
.form input:focus, .form textarea:focus { outline: none; border-color: rgba(17,17,17,.35); background: rgba(255,255,255,.85); }
.opts { display: flex; flex-wrap: wrap; gap: 4px; }
.opt { display: inline-flex !important; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { padding: 4px 8px; border-radius: 3px; background: rgba(17,17,17,.06); font-size: 12px; transition: background .2s, color .2s; }
.opt input:checked + span { background: var(--ink); color: var(--bg); }
.opt input:focus-visible + span { outline: 1px solid var(--ink); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; }
.form__send {
  height: 34px; margin-top: 4px;
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: 6px; cursor: pointer;
}
.form__send:hover { background: #333; }
.form__send:disabled { opacity: .5; cursor: progress; }
.form__or { text-align: center; color: var(--mid); text-transform: lowercase; margin: -2px 0; }
.form__call {
  display: flex; align-items: center; justify-content: center; height: 34px;
  border: 1px solid var(--ink); border-radius: 6px; color: var(--ink);
  transition: background .2s, color .2s;
}
.form__call:hover { background: var(--ink); color: var(--bg); }
.form__status { min-height: 1em; text-transform: none; }
.form__status.is-ok { color: #111111; }
.form__status.is-err { color: #555555; }

/* ---------- Reveal ---------- */
.js .focus__item, .js .project, .js .words figure {
  opacity: 0; transform: translateY(16px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js .is-in { opacity: 1 !important; transform: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* two columns, two rows collapsed */
  .work__list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .js .work:not(.is-open) .project:nth-child(4) { display: block; }
  .js .work:not(.is-open) .project:nth-child(n+5) { display: none; }
  .work__more { margin-top: 28px; }
  .info { margin-top: 10px; gap: 2px; }
  .project .info__row { grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .project .info__row:not(.info__head) > :first-child, .project .info__note { display: none; }
  .about__lead, .about__services { grid-column: 1 / -1; }
  .about__lead .statement { position: static; }
  .statement__brand { display: inline; }
  .about__services { padding: 0; margin-top: 56px; gap: 36px; }
  .svc .info__head { display: grid; }
  .words__grid { grid-template-columns: 1fr; row-gap: 36px; }
  .focus__item { grid-column: 1 / -1; }
  .focus__grid { row-gap: 28px; }

}

@media (max-width: 640px) {
  .hero { font-size: 13px; min-height: 0; }
  main > .focus { padding-top: 56px; }
  .irow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .irow__label { grid-column: 1; }
  .irow__items { grid-column: 2; }
  .irow::after { width: 4.5em; }
  .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .top__brand img { height: 26px; }
  .top__brand a { gap: 8px; }
  .top__name { font-size: 11px; }
  .top__nav { gap: 3px; flex-shrink: 0; }
  .top__nav .chip { padding: 0 7px; }
  .statement { text-indent: 0; }
  .faq summary { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding-right: 24px; }
  .faq__n { grid-column: 1; }
  .faq__q { grid-column: 2; padding-right: 0; }
  .faq details p { margin-left: 44px; }
}

@media (max-width: 370px) {
  .top { gap: 6px; }
  .top__nav .chip { padding: 0 5px; font-size: 11px; }
}
/* the smallest phones: no room for the name beside the logo */
@media (max-width: 350px) {
  .top__name { display: none; }
}
@media (max-width: 330px) {
  .top__nav { gap: 2px; }
  .top__nav .chip { padding: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .focus__item, .js .project, .js .words figure { opacity: 1; transform: none; }
  .js .about__lead .statement { transition: none; }
}
