/* =========================================================
   IMscout — Holding Company
   Dark premium aesthetic — Poppins (display) + Inter (body)
   ========================================================= */

:root {
  /* Palette — derived from logo (charcoal + red) */
  --bg:           #0A0A0A;
  --bg-elev:      #111111;
  --bg-card:      #151515;
  --bg-hover:     #1a1a1a;
  --border:       #1f1f1f;
  --border-strong:#2a2a2a;
  --text:         #F2F2F2;
  --text-muted:   #8a8a8a;
  --text-dim:     #5a5a5a;
  --accent:       #E50026;
  --accent-soft:  #ff2a4d;
  --accent-glow:  rgba(229, 0, 38, 0.18);

  /* Type */
  --f-display: "Poppins", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --max:    1440px;
  --pad:    clamp(1.25rem, 4vw, 3.25rem);
  --gap:    clamp(1rem, 2vw, 1.5rem);
  --radius: 4px;

  /* Motion */
  --ease:   cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

button { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

/* =========================================================
   Reveal animation (driven by IntersectionObserver in JS)
   ========================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Top bar
   ========================================================= */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  background: linear-gradient(180deg, rgba(10,10,10,0.85), rgba(10,10,10,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.35s var(--ease), padding 0.35s var(--ease);
}
.topbar.is-scrolled {
  background: rgba(10,10,10,0.92);
  border-bottom: 1px solid var(--border);
  padding: 12px var(--pad);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand svg { height: 28px; width: auto; }
.brand-name { color: var(--text); }
.brand-name b { color: var(--accent); }

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.topnav a {
  color: var(--text-muted);
  padding: 6px 2px;
  position: relative;
  transition: color 0.25s var(--ease);
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.topnav a:hover { color: var(--text); }
.topnav a:hover::after { width: 100%; }

@media (max-width: 640px) {
  .topnav { gap: 18px; font-size: 12px; }
  .topnav a:nth-child(1) { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  min-height: 100svh;
  padding: clamp(80px, 14vh, 140px) var(--pad) clamp(40px, 7vh, 80px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* ── Hero background: atmospheric gradient orbs ── */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-bg::before {
  content: "";
  position: absolute;
  width: clamp(560px, 88vw, 1300px);
  height: clamp(380px, 58vw, 860px);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(229,0,38,0.28) 0%,
    rgba(180,0,30,0.12) 38%,
    transparent 68%
  );
  bottom: -28%;
  left: -18%;
  filter: blur(72px);
  animation: bgBlob1 38s ease-in-out infinite;
}

.hero-bg::after {
  content: "";
  position: absolute;
  width: clamp(380px, 62vw, 860px);
  height: clamp(320px, 52vw, 760px);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(229,0,38,0.14) 0%,
    rgba(160,0,20,0.06) 38%,
    transparent 66%
  );
  top: -22%;
  right: -14%;
  filter: blur(58px);
  animation: bgBlob2 52s ease-in-out infinite;
}

@keyframes bgBlob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  28%     { transform: translate(10%, -9%) scale(1.07); }
  56%     { transform: translate(-6%, 13%) scale(0.93); }
  80%     { transform: translate(7%, 4%) scale(1.04); }
}

@keyframes bgBlob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  36%     { transform: translate(-10%, 12%) scale(1.12); }
  70%     { transform: translate(6%, -8%) scale(0.95); }
}

.hero-dot {
  position: absolute;
  top: clamp(80px, 18vh, 200px);
  right: clamp(-40px, -3vw, -20px);
  width: clamp(180px, 32vw, 420px);
  height: clamp(180px, 32vw, 420px);
  border-radius: 50%;
  background: var(--accent);
  filter: blur(0px);
  opacity: 1;
  z-index: 0;
  animation:
    heroDotFloat 18s ease-in-out infinite,
    heroDotGlow 6s ease-in-out infinite;
  box-shadow: 0 30px 120px var(--accent-glow);
}
.hero-dot::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  filter: blur(40px);
  z-index: -1;
}

@keyframes heroDotFloat {
  0%,100% { transform: translate3d(0, 0, 0) scale(1); }
  25%     { transform: translate3d(-2%, 4%, 0) scale(1.03); }
  55%     { transform: translate3d(-3.5%, 1.5%, 0) scale(0.97); }
  78%     { transform: translate3d(-1%, 5%, 0) scale(1.02); }
}

@keyframes heroDotGlow {
  0%,100% { box-shadow: 0 30px 120px rgba(229,0,38,0.18); }
  50%     { box-shadow: 0 50px 200px rgba(229,0,38,0.35), 0 0 80px rgba(229,0,38,0.12); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding-top: clamp(40px, 8vh, 100px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: clamp(28px, 5vh, 56px);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(24px, 4vh, 40px);
  color: var(--text);
  text-wrap: balance;
  max-width: 16ch;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .muted { color: var(--text-muted); }

.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
  text-wrap: pretty;
}
.hero-sub strong {
  font-weight: 500;
  color: var(--text);
}

.hero-foot {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.hero-foot-list {
  display: flex;
  gap: clamp(14px, 2.5vw, 36px);
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  list-style: none;
  padding: 0; margin: 0;
}
.hero-foot-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}
.hero-foot-list a:hover { color: var(--text); }
.hero-foot-list a .num { color: var(--accent); }

.hero-scroll {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.hero-scroll::after {
  content: "";
  display: inline-block;
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: 0.3; transform: scaleY(0.4); transform-origin: top; }
  50%     { opacity: 1; transform: scaleY(1); }
}

/* =========================================================
   Section: About
   ========================================================= */

.section {
  position: relative;
  padding: clamp(80px, 14vh, 160px) var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
  margin-bottom: clamp(48px, 8vh, 96px);
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.section-head h2 .accent { color: var(--accent); }

@media (max-width: 768px) {
  .section-head { grid-template-columns: 1fr; gap: 20px; }
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(36px, 5vh, 64px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: clamp(40px, 6vh, 80px);
}
.stat-num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
}
.stat-num .accent { color: var(--accent); }
.stat-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .about-stats { grid-template-columns: 1fr; gap: 28px; }
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 48px);
  margin-top: clamp(40px, 6vh, 80px);
}
.principle {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.principle-num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
}
.principle h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.principle p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .about-principles { grid-template-columns: 1fr; }
}

/* =========================================================
   Portfolio — companies as fullscreen chapters
   ========================================================= */

.portfolio-intro {
  position: relative;
  padding: clamp(80px, 14vh, 160px) var(--pad) clamp(60px, 10vh, 100px);
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.portfolio-intro .label-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.portfolio-intro .label-line .bar {
  flex: 0 0 48px;
  height: 1px;
  background: var(--accent);
}
.portfolio-intro h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  text-wrap: balance;
  max-width: 18ch;
}
.portfolio-intro h2 .accent { color: var(--accent); }
.portfolio-intro p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}

/* Company chapter */
.company {
  position: relative;
  min-height: 100svh;
  padding: clamp(60px, 8vh, 100px) var(--pad);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.company-inner {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.company:nth-child(even) .company-inner {
  grid-template-columns: 1.1fr 1fr;
}
.company:nth-child(even) .company-text { order: 2; }
.company:nth-child(even) .company-visual { order: 1; }

@media (max-width: 900px) {
  .company-inner,
  .company:nth-child(even) .company-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .company:nth-child(even) .company-text { order: 1; }
  .company:nth-child(even) .company-visual { order: 2; }
}

.company-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(24px, 4vh, 40px);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.company-num {
  color: var(--accent);
  font-weight: 500;
}
.company-meta .sep {
  width: 28px; height: 1px;
  background: var(--border-strong);
}
.company-sector { color: var(--text-muted); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status.is-primary { color: var(--accent); border-color: rgba(229,0,38,0.45); }
.status.is-primary::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(229,0,38,0.18); animation: pulse 2.4s ease-in-out infinite; }
.status.is-active { color: #cfcfcf; }
.status.is-active::before { background: #cfcfcf; }
.status.is-emerging { color: var(--text-muted); }
.status.is-emerging::before { background: var(--text-muted); }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(229,0,38,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(229,0,38,0.04); }
}

.company-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.company-name .accent { color: var(--accent); }

.company-tag {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  color: var(--text);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.company-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 52ch;
  margin: 0 0 32px;
  text-wrap: pretty;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.chip {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  color: var(--text-muted);
  background: var(--bg-card);
}

.company-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  padding: 14px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  transition: all 0.3s var(--ease);
  background: var(--bg-card);
}
.company-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(2px);
}
.company-link .arrow {
  transition: transform 0.3s var(--ease);
}
.company-link:hover .arrow { transform: translateX(4px); }

.company-link.is-disabled {
  cursor: not-allowed;
  color: var(--text-dim);
  border-style: dashed;
}
.company-link.is-disabled:hover {
  border-color: var(--border-strong);
  color: var(--text-dim);
  transform: none;
}

/* Visual side */
.company-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 80vh;
}

.company-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

image-slot {
  --slot-bg: var(--bg-card);
  --slot-border: var(--border);
  --slot-text: var(--text-muted);
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.company-visual::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.company.is-visible .company-visual::after {
  opacity: 0.0;
}

.visual-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(10,10,10,0.75);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  z-index: 2;
  pointer-events: none;
}

/* =========================================================
   Sticky portfolio progress (desktop)
   ========================================================= */

.portfolio-progress {
  position: fixed;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.portfolio-progress.is-active {
  opacity: 1;
  pointer-events: auto;
}
.pp-item {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.pp-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s var(--ease);
}
.pp-item .name { opacity: 0; transform: translateX(6px); transition: all 0.3s var(--ease); }
.pp-item:hover { color: var(--text); }
.pp-item:hover .name { opacity: 1; transform: translateX(0); }
.pp-item.is-current { color: var(--accent); }
.pp-item.is-current .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(229,0,38,0.18); }
.pp-item.is-current .name { opacity: 1; transform: translateX(0); }

@media (max-width: 1100px) {
  .portfolio-progress { display: none; }
}

/* =========================================================
   Contact / Footer
   ========================================================= */

.contact {
  position: relative;
  padding: clamp(100px, 16vh, 180px) var(--pad) clamp(60px, 10vh, 100px);
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse at top right, rgba(229,0,38,0.07), transparent 60%),
    var(--bg);
}
.contact-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.contact h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(40px, 7vh, 80px);
  text-wrap: balance;
  max-width: 18ch;
}
.contact h2 .accent { color: var(--accent); }

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  padding-bottom: clamp(60px, 10vh, 100px);
  border-bottom: 1px solid var(--border);
}
.contact-block .label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.contact-block .value {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--text);
  line-height: 1.4;
}
.contact-block .value a {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: border-color 0.3s var(--ease);
}
.contact-block .value a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: clamp(32px, 5vh, 48px);
  gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.footer-brand-mark svg,
.footer-brand-mark img { height: 22px; width: auto; }

@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Tweaks panel scaffolding overrides (we use the starter)
   ========================================================= */

/* Hidden by default — only visible when Tweaks toolbar toggle is on */
