/* Good Tech Studio — shared components (header, footer, marquee, project card) */

/* ---------- Intro loader ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  overflow: hidden;
  pointer-events: none;
}
/* font-size:0 on the row kills inline-block whitespace between letters and slots */
.intro__row {
  display: inline-block;
  white-space: nowrap;
  font-size: 0;
  max-width: 100vw;
}
.intro__g,
.intro__d,
.intro__slot {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(80px, 18vw, 240px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--ink);
  vertical-align: baseline;
}
.intro__field { display: inline; }
.intro__slot {
  overflow: visible;
  will-change: width;
}
.intro__o {
  display: inline-block;
  will-change: transform, opacity;
}
.intro__sub {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 22px);
  letter-spacing: 0.32em;
  color: var(--ink);
  opacity: 0;
  white-space: nowrap;
}

/* Intro v2: letters spread on a diagonal across the viewport, then a circular
   hole grows from the orange O's center, revealing the homepage underneath. */
.intro--zoom {
  --hole-x: 50%;
  --hole-y: 50%;
  --hole-r: 0px;
  -webkit-mask-image: radial-gradient(
    circle at var(--hole-x) var(--hole-y),
    transparent var(--hole-r),
    black calc(var(--hole-r) + 2px)
  );
          mask-image: radial-gradient(
    circle at var(--hole-x) var(--hole-y),
    transparent var(--hole-r),
    black calc(var(--hole-r) + 2px)
  );
}
/* Grid of letters that fills the viewport: G top-left, D bottom-right, O's everywhere else */
.intro__grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(5, 1fr);
  place-items: center;
  padding: 4vh 2vw;
}
.intro__grid-letter {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(28px, 7vw, 110px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  will-change: transform, opacity;
}
.intro__grid-letter--orange {
  color: var(--accent-orange);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: color-mix(in oklab, var(--paper) 80%, transparent);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}
.site-header .wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-header .wordmark .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
/* Wordmark letter scaffolding for the intro animation (GOD → GOOD → GOOOD).
   Each letter is its own inline-block so it can transform independently.
   font-size: 0 on the container kills the whitespace between sibling inline-blocks
   (each newline in the template literal would otherwise render as a visible gap). */
.site-header .wordmark .wm {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  font-size: 0;
}
.site-header .wordmark .wm__l,
.site-header .wordmark .wm__sp,
.site-header .wordmark .wm__slot {
  display: inline-block;
  font-size: 17px;
  will-change: transform;
}
.site-header .wordmark .wm__o {
  transform-origin: 50% 60%;
}
/* The middle O is the one that falls from above — it stays orange permanently */
.site-header .wordmark .wm__o3 {
  color: var(--accent-orange);
}
/* Collapsible slots for the two extra O's. width is set inline (via JS measurement)
   so they start hidden and animate to their natural width. */
.site-header .wordmark .wm__slot {
  overflow: hidden;
  vertical-align: baseline;
  width: 0;
}
.site-header nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 36px);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
}
.site-header nav a {
  position: relative;
  padding: 6px 2px;
  opacity: 0.7;
  transition: opacity var(--dur-fast) var(--ease-out-expo);
}
.site-header nav a:hover { opacity: 1; }
.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out-expo);
}
.site-header nav a:hover::after { transform: scaleX(1); }

/* Design-picker pill (A · B · C · D switcher) */
.design-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.design-picker__label {
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 4px;
}
.design-picker__opt {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.55;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.design-picker__opt:hover { opacity: 1; background: color-mix(in oklab, var(--ink) 10%, transparent); }
.design-picker__opt.is-active {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}
@media (max-width: 960px) {
  .design-picker__label { display: none; }
  .design-picker { padding: 4px; }
}

/* Theme switch (legacy, retained for now) */
.theme-switch {
  display: inline-flex;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border-radius: 999px;
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.theme-switch a {
  padding: 6px 12px;
  border-radius: 999px;
  opacity: 0.6;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.theme-switch a.is-active {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}

.site-header .cta-mini {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: transform var(--dur-fast) var(--ease-out-expo);
}
.site-header .cta-mini:hover { transform: translateY(-1px); }

@media (max-width: 880px) {
  .site-header nav { display: none; }
  .site-header { padding: 14px var(--gutter); }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: clamp(60px, 10vw, 120px) var(--gutter) 40px;
  border-top: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}
.site-footer .container { display: grid; gap: 60px; }
.site-footer .massive-wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(48px, 14vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--ink);
  display: block;
  user-select: none;
  white-space: nowrap;
}
.site-footer .massive-wordmark .extra-o {
  display: inline-block;
  color: var(--accent-orange);
  transform: rotate(12deg);
  transition: transform 600ms var(--ease-out-expo);
}
.site-footer .massive-wordmark:hover .extra-o {
  transform: translateY(-6px) rotate(-8deg);
}
.site-footer .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.site-footer .meta a:hover { opacity: 0.6; }

/* ---------- Tools / Logo marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 24px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: clamp(40px, 6vw, 80px);
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.marquee__item::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.4;
}
@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

/* ---------- Reveal utilities (driven by main.js + IntersectionObserver) ----------
   Content is visible by default. JS adds `.js` to <html> at boot and only THEN
   hides reveal targets — so screenshot/SEO/no-JS users see everything. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms var(--ease-out-expo), transform 800ms var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Char-by-char headline reveal (also JS-gated) */
.word-wrap {
  display: inline-block;
  white-space: nowrap;
}
.char-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.char-mask > span {
  display: inline-block;
  transform: translateY(0);
}
.js .char-mask > span {
  transform: translateY(110%);
  transition: transform 800ms var(--ease-out-expo);
  transition-delay: var(--char-delay, 0ms);
}
.js .char-mask.is-visible > span { transform: translateY(0); }

/* Tag pills */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}
.tag::before {
  content: "✓";
  font-family: var(--font-sans);
  font-size: 10px;
  opacity: 0.5;
}
