/* ============================================================
   TNE — Components
   Header, footer, buttons, cards, marquee, cursor, page-chrome
   ============================================================ */

/* — Page chrome: top-left status, scroll progress bar — */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  transition: width 120ms linear;
}

/* — Back to top — */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out), background 220ms var(--ease-out);
  box-shadow: 0 8px 24px -8px rgba(20,19,15,0.35);
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover { background: var(--accent); color: #fff; }
.back-to-top svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* — Header — */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: transparent;
  transition: background 320ms var(--ease-out), border-color 320ms var(--ease-out), padding 320ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(244, 241, 235, 0.78);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border-bottom-color: var(--line);
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand .brand-mark {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-1px);
  margin-right: 4px;
}
.brand .brand-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 2px;
}

.nav-primary {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px;
}
.nav-primary a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  color: var(--ink);
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out);
}
.nav-primary a:hover { background: var(--bg); }
.nav-primary a.active { background: var(--ink); color: var(--bg); }
@media (max-width: 900px) { .nav-primary { display: none; } }

.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.nav-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-meta .live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 61, 0, 0.35); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(255, 61, 0, 0); }
}
@media (max-width: 720px) { .nav-meta { display: none; } }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  align-items: center;
  justify-content: center;
  cursor: none;
}
.menu-toggle svg { width: 18px; height: 18px; }
.menu-toggle { cursor: pointer; }
@media (max-width: 900px) { .menu-toggle { display: inline-flex; } }

/* — Mobile: tighten header — */
@media (max-width: 600px) {
  .site-header { padding: 16px var(--gutter); gap: 8px; }
  .nav-right { gap: 8px; }
  .site-header .btn { padding: 10px 14px; font-size: 12px; }
  .site-header .btn .arrow { width: 14px; height: 14px; }
  .brand-sub { display: none; }
  .brand { font-size: 16px; }
  .menu-toggle { width: 40px; height: 40px; }
}
@media (max-width: 420px) {
  .site-header .btn { display: none; }
}

/* — Mobile menu — */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  transform: translateY(-100%);
  transition: transform 540ms var(--ease-power);
  padding: 100px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}
.mobile-menu.open { transform: none; }
.mobile-menu a {
  font-family: var(--f-display);
  font-size: clamp(40px, 12vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

/* — Buttons — */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  background: var(--ink);
  color: var(--bg);
  transition: background 220ms var(--ease-out), transform 220ms var(--ease-out), color 220ms var(--ease-out);
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn .arrow {
  width: 18px; height: 18px;
  transition: transform 220ms var(--ease-out);
}
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-lg {
  padding: 22px 32px;
  font-size: 16px;
  border-radius: var(--r-pill);
}

/* Circular CTA */
.btn-circle {
  --size: 180px;
  position: relative;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: background 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.btn-circle:hover { background: var(--accent); transform: scale(1.04); }
.btn-circle .btn-circle-arrow {
  position: relative;
  z-index: 2;
  width: 32px; height: 32px;
}
.btn-circle .rotating-text {
  position: absolute;
  inset: 0;
  animation: spin 18s linear infinite;
}
.btn-circle:hover .rotating-text { animation-duration: 8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-circle .rotating-text text {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--bg);
}

/* Link arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  transition: border-color 220ms var(--ease-out), color 220ms var(--ease-out);
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow svg { width: 14px; height: 14px; transition: transform 220ms var(--ease-out); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* — Marquee — */
.marquee {
  overflow: hidden;
  width: 100%;
  position: relative;
  user-select: none;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 64px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  will-change: transform;
}
.marquee-track.reverse { animation-direction: reverse; }
.marquee-track.fast { animation-duration: 28s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* — Card: project — */
.work-card {
  position: relative;
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-deep);
}
.work-card .work-media {
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}
.work-card .work-media .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(20, 19, 15, 0.4);
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(20,19,15,0.04) 18px 19px);
  transition: transform 800ms var(--ease-out);
}
.work-card:hover .work-media .ph { transform: scale(1.04); }
.work-card .work-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px 4px 0;
  gap: 16px;
}
.work-card .work-title {
  font-family: var(--f-display);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 400;
}
.work-card .work-tags {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.work-card .work-year {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Work card color variants (placeholder shades) */
.work-card.tint-1 { background: #E8E2D4; }
.work-card.tint-2 { background: #1F1E1A; color: var(--bg); }
.work-card.tint-2 .ph { color: rgba(244, 241, 235, 0.45); background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(244,241,235,0.06) 18px 19px); }
.work-card.tint-3 { background: #DCD6C6; }
.work-card.tint-4 { background: #FFE9DC; }
.work-card.tint-5 { background: #C8C2B2; }
.work-card.tint-accent { background: var(--accent); color: var(--accent-ink); }
.work-card.tint-accent .ph { color: rgba(255,255,255,0.6); background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,0.1) 18px 19px); }

/* — Service row (numbered, expandable look) — */
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 220px auto;
  align-items: center;
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: padding 320ms var(--ease-out);
}
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row .num {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.service-row .title {
  font-family: var(--f-display);
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
  transition: color 220ms var(--ease-out), transform 320ms var(--ease-out);
}
.service-row .desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.service-row .arrow-c {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out), color 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.service-row:hover .arrow-c { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-12deg); }
.service-row:hover .title { font-style: italic; color: var(--ink); }
@media (max-width: 900px) {
  .service-row { grid-template-columns: 56px 1fr auto; }
  .service-row .desc { grid-column: 2 / 4; }
}

/* — Stats — */
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 0;
}
.stat .stat-num {
  font-family: var(--f-display);
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.stat .stat-num .unit { font-style: italic; font-size: 0.5em; vertical-align: super; color: var(--accent); margin-left: 2px; }
.stat .stat-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* — Testimonial — */
.testimonial-quote {
  font-family: var(--f-display);
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.testimonial-quote::before { content: "\201C"; color: var(--accent); }
.testimonial-quote::after { content: "\201D"; color: var(--accent); }

/* — Tag chip — */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* — Footer — */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: var(--s-9) var(--gutter) 32px;
  position: relative;
  overflow: hidden;
}
.site-footer .footer-mega {
  display: block;
  width: 100%;
  margin: 0 0 48px;
  color: var(--bg);
  line-height: 0;
  opacity: 0.45;
  filter: blur(0.5px);
  transition: opacity 600ms var(--ease-out), filter 600ms var(--ease-out);
}
@media (max-width: 600px) {
  .site-footer .footer-mega { margin: 0 0 32px; opacity: 0.65; }
}
.site-footer:hover .footer-mega { opacity: 0.85; filter: blur(0); }
.site-footer .footer-mega svg { display: block; width: 100%; height: auto; overflow: visible; }
.site-footer .footer-mega em { color: var(--accent); font-style: normal; }
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 48px;
  border-top: 1px solid rgba(244, 241, 235, 0.16);
}
@media (max-width: 900px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
.site-footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 241, 235, 0.5);
  margin: 0 0 16px;
}
.site-footer .f-col a {
  display: block;
  padding: 6px 0;
  font-size: 15px;
  color: var(--bg);
  transition: color 220ms var(--ease-out), padding-left 220ms var(--ease-out);
}
.site-footer .f-col a:hover { color: var(--accent); padding-left: 6px; }
.site-footer .colophon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 241, 235, 0.16);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 241, 235, 0.6);
}

/* Page intro (used on subpages) */
.page-intro {
  padding: 200px var(--gutter) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 900px) { .page-intro { grid-template-columns: 1fr; gap: 32px; padding-top: 140px; } }

.crumbs {
  display: flex;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.crumbs .sep { color: var(--accent); }

/* Generic media placeholder */
.media-ph {
  width: 100%;
  background: var(--bg-deep);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(20, 19, 15, 0.4);
  background-image: repeating-linear-gradient(45deg, transparent 0 18px, rgba(20,19,15,0.04) 18px 19px);
  position: relative;
}
.media-ph::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  pointer-events: none;
}
