
/* ==========================================================
   DEVELOPER PORTFOLIO — EDITORIAL AI HERO
   FILE: css/hero.css
   VERSION: 5.0

   THEME:
   Charcoal / White / Crimson Red

   Compatible with:
   - Existing AI build agent
   - Existing AI inspector and cursor
   - GSAP ScrollTrigger
   - Reversible scroll construction

   IMPORTANT:
   The corresponding hero.js timeline must be updated.
========================================================== */

/* ==========================================================
   1. VARIABLES
========================================================== */

.hero-section {
  --hero-bg: #101012;
  --hero-bg-soft: #17171a;
  --hero-red: #ed2939;
  --hero-red-light: #ff4355;
  --hero-white: #f7f7f8;
  --hero-muted: #a8a8ad;
  --hero-edge: clamp(22px, 5.5vw, 96px);

  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 650px;

  overflow: hidden;
  isolation: isolate;

  background:
    radial-gradient(
      ellipse at 76% 56%,
      rgba(140, 12, 27, 0.14),
      transparent 43%
    ),
    linear-gradient(
      120deg,
      #111113 0%,
      #151518 55%,
      #101012 100%
    );

  color: var(--hero-white);
}

/* ==========================================================
   2. MAIN STAGE
========================================================== */

.hero-stage {
  position: relative;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;

  padding-inline: var(--hero-edge);

  overflow: hidden;
  isolation: isolate;
}

/* ==========================================================
   3. BLUEPRINT BACKGROUND
========================================================== */

.blueprint-layer {
  position: absolute;
  inset: 0;
  z-index: 1;

  overflow: hidden;
  pointer-events: none;
}

.blueprint-grid {
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(
      rgba(237, 41, 57, 0.075) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(237, 41, 57, 0.075) 1px,
      transparent 1px
    );

  background-size: 76px 76px;
  background-position: center;

  opacity: 0;

  -webkit-mask-image: radial-gradient(
    ellipse at center,
    #000 24%,
    transparent 92%
  );

  mask-image: radial-gradient(
    ellipse at center,
    #000 24%,
    transparent 92%
  );
}

.blueprint-grid::after {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(
    ellipse at center,
    transparent 25%,
    rgba(16, 16, 18, 0.75) 100%
  );
}

/* ==========================================================
   4. CONSTRUCTION GUIDES
========================================================== */

.guide {
  position: absolute;
  pointer-events: none;
  background: rgba(237, 41, 57, 0.42);
}

.guide-h {
  left: 0;
  width: 100%;
  height: 1px;
  transform-origin: left center;
}

.guide-v {
  top: 0;
  height: 100%;
  width: 1px;
  transform-origin: center top;
}

.guide-h-1 { top: 12%; }
.guide-h-2 { top: 54%; }
.guide-h-3 { top: 88%; }

.guide-v-1 { left: 5%; }
.guide-v-2 { left: 50%; }
.guide-v-3 { right: 5%; }

.blueprint-label {
  position: absolute;
  bottom: 10%;
  left: 6%;

  font-family: monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;

  color: var(--hero-red-light);
}

/* ==========================================================
   5. NAVIGATION HEADER
========================================================== */

.build-header {
  position: relative;
  z-index: 20;

  width: 100%;
  height: clamp(74px, 9vh, 96px);
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.build-header-border {
  position: absolute;
  left: 0;
  bottom: 0;

  width: 100%;
  height: 1px;

  background: rgba(255, 255, 255, 0.14);
  transform-origin: left center;
}

.build-logo {
  position: relative;
  z-index: 2;

  font-family: var(--font-display, sans-serif);
  font-size: clamp(28px, 2.7vw, 42px);
  font-weight: 800;

  letter-spacing: -0.095em;
  line-height: 1;

  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.build-logo span {
  color: var(--hero-red);
}

.build-nav {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: clamp(18px, 3vw, 50px);
}

.build-nav a {
  position: relative;

  padding: 12px 0;

  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 600;
  letter-spacing: 0.035em;

  color: #c8c8cc;
  text-decoration: none;

  transition: color 0.3s ease;
}

.build-nav a::after {
  content: "";

  position: absolute;
  left: 0;
  bottom: 3px;

  width: 100%;
  height: 2px;

  background: var(--hero-red);

  transform: scaleX(0);
  transform-origin: left center;

  transition: transform 0.3s ease;
}

.build-nav a:hover,
.build-nav a:focus-visible {
  color: #fff;
}

.build-nav a:hover::after,
.build-nav a:focus-visible::after,
.build-nav a:first-child::after {
  transform: scaleX(1);
}

.build-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-family: monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;

  color: #d6d6d9;
  white-space: nowrap;
}

.build-header-meta::before {
  content: "";
  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--hero-red);

  box-shadow: 0 0 12px rgba(237, 41, 57, 0.65);
}

/* ==========================================================
   6. EDITORIAL HERO AREA
========================================================== */

.hero-editorial {
  position: relative;
  z-index: 3;

  flex: 1;
  min-height: 0;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding-top: clamp(14px, 3vh, 38px);
  padding-bottom: clamp(14px, 3vh, 35px);
}

/* ==========================================================
   7. DECORATIVE SIDE LABEL
========================================================== */

.hero-side-index {
  position: absolute;
  z-index: 4;

  top: 5%;
  left: 0;

  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.13em;

  color: var(--hero-red-light);
}

/* ==========================================================
   8. CRIMSON CIRCULAR BACKGROUND
========================================================== */

.hero-orbit {
  position: absolute;
  z-index: 1;

  width: clamp(420px, 49vw, 790px);
  aspect-ratio: 1;

  top: 50%;
  right: -2%;

  transform: translateY(-47%);

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 50% 55%,
      rgba(237, 41, 57, 0.7) 0%,
      rgba(185, 15, 35, 0.56) 30%,
      rgba(110, 8, 22, 0.36) 55%,
      transparent 73%
    );

  pointer-events: none;
}

.hero-orbit::before {
  content: "";
  position: absolute;

  inset: 10%;
  border-radius: 50%;

  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(238, 30, 52, 0.55),
      rgba(160, 13, 32, 0.34) 57%,
      rgba(90, 10, 25, 0.08) 71%,
      transparent 73%
    );

  box-shadow:
    0 0 100px rgba(215, 20, 42, 0.13),
    inset 0 0 90px rgba(20, 0, 8, 0.24);
}

.hero-orbit::after {
  content: "";
  position: absolute;

  inset: 3%;
  border-radius: 50%;

  border: 1px solid rgba(237, 41, 57, 0.45);
}

.hero-orbit-ring {
  position: absolute;
  inset: -7%;

  border: 1px solid rgba(237, 41, 57, 0.24);
  border-radius: 50%;

  transform: rotate(-15deg) scaleX(0.92);
}

.hero-orbit-ring-inner {
  inset: 19%;

  border-color: rgba(255, 255, 255, 0.07);
  transform: rotate(15deg) scaleX(1.12);
}

/* ==========================================================
   9. MAIN NAME TYPOGRAPHY
========================================================== */

.build-title-area {
  position: relative;
  z-index: 5;

  width: 64%;
  flex: 0 0 auto;

  margin-top: clamp(26px, 5vh, 60px);
  margin-bottom: clamp(14px, 2.2vh, 28px);

  transform-origin: left center;
}

.build-title {
  position: relative;

  width: 100%;
  margin: 0;

  text-align: left;

  font-family: var(
    --font-display,
    "Arial Black",
    sans-serif
  );

  font-size: clamp(58px, 7.7vw, 150px);
  font-weight: 900;

  line-height: 0.86;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

.build-title-text {
  display: inline-block;
  position: relative;

  color: var(--hero-white);
  -webkit-text-stroke: 0 transparent;

  transform-origin: left center;
}

.build-title-text em {
  font-style: normal;
  color: var(--hero-red);
}

.build-title-text b {
  color: var(--hero-white);
  font-weight: inherit;
}

/* ==========================================================
   10. TITLE CONSTRUCTION GUIDES
========================================================== */

.title-guide {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;

  background: rgba(237, 41, 57, 0.75);

  transform-origin: left center;
  pointer-events: none;
}

.title-guide-top {
  top: -14px;
}

.title-guide-bottom {
  bottom: -16px;
}

.title-coordinate {
  position: absolute;

  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.08em;

  color: var(--hero-red-light);
}

.coordinate-left {
  top: -33px;
  left: 0;
}

.coordinate-right {
  bottom: -35px;
  right: 0;
}

/* ==========================================================
   11. PORTRAIT
========================================================== */

.build-hero-image {
  position: absolute;
  z-index: 6;

  right: -1%;
  bottom: -3%;

  width: clamp(330px, 43vw, 730px);
  height: 105%;

  pointer-events: none;
}

.hero-image-halo {
  position: absolute;
  z-index: 0;

  left: 3%;
  right: 3%;
  bottom: 5%;

  height: 65%;

  border-radius: 50%;

  background: radial-gradient(
    ellipse at center,
    rgba(237, 41, 57, 0.3),
    transparent 70%
  );

  filter: blur(25px);
}

.hero-image-frame {
  position: absolute;
  z-index: 1;

  inset: 0;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  overflow: hidden;
}

.hero-profile-img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center bottom;

  filter:
    drop-shadow(
      -25px 15px 45px rgba(0, 0, 0, 0.42)
    );

  transform-origin: bottom center;
}

.hero-image-label {
  position: absolute;
  z-index: 3;

  bottom: 7%;
  right: 4%;

  font-family: monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;

  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================
   12. DEVELOPER INTRODUCTION
========================================================== */

.build-content {
  position: relative;
  z-index: 8;

  width: min(57%, 820px);

  display: grid;
  grid-template-columns: 0.9fr 1.1fr;

  gap: clamp(12px, 2vw, 30px);

  margin-top: clamp(12px, 2vh, 25px);
  margin-bottom: clamp(12px, 2vh, 24px);

  transform-origin: left center;
}

/* ==========================================================
   13. MINIMAL CONTENT PANELS
========================================================== */

.build-panel {
  position: relative;

  min-width: 0;
  min-height: 110px;

  display: flex;
  align-items: center;

  padding: 12px 0 12px 20px;

  background: transparent;

  overflow: hidden;

  transform-origin: center center;
  --corner-opacity: 0;
}

.build-panel-left {
  border-left: 3px solid var(--hero-red);
}

.build-panel-right {
  border-left: 1px solid rgba(237, 41, 57, 0.42);
}

.panel-real-content {
  position: relative;
  z-index: 2;

  width: 100%;
}

.build-eyebrow {
  display: block;

  margin-bottom: 10px;

  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;

  color: var(--hero-red-light);
}

.build-panel h2 {
  margin: 0;

  font-family: var(
    --font-display,
    sans-serif
  );

  font-size: clamp(24px, 2.6vw, 45px);
  font-weight: 700;

  line-height: 1.03;
  letter-spacing: -0.05em;

  color: var(--hero-white);
}

.build-panel h2 span {
  color: var(--hero-white);
}

.build-panel p {
  max-width: 42ch;
  margin: 0;

  font-size: clamp(12px, 0.97vw, 15px);
  line-height: 1.65;

  color: #bcbcc2;
}

/* ==========================================================
   14. SVG BORDER COMPATIBILITY
========================================================== */

.panel-border-svg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  overflow: hidden;
  pointer-events: none;

  z-index: 3;
}

.panel-draw-path {
  fill: none;

  stroke: rgba(237, 41, 57, 0.55);
  stroke-width: 1;
  stroke-linecap: square;

  vector-effect: non-scaling-stroke;
}

.build-panel::before,
.build-panel::after {
  content: "";

  position: absolute;

  width: 9px;
  height: 9px;

  border-color: var(--hero-red);
  border-style: solid;

  opacity: var(--corner-opacity, 0);
  pointer-events: none;

  z-index: 4;
}

.build-panel::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.build-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

/* ==========================================================
   15. PLACEHOLDER SKELETONS
========================================================== */

.panel-placeholder {
  position: absolute;
  inset: 18px 20px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 10px;

  opacity: 0;
  pointer-events: none;

  z-index: 1;
}

.panel-placeholder span {
  display: block;

  height: 7px;

  background: rgba(237, 41, 57, 0.28);

  transform-origin: left center;
}

.panel-placeholder span:nth-child(1) {
  width: 38%;
}

.panel-placeholder span:nth-child(2) {
  width: 78%;
}

.panel-placeholder span:nth-child(3) {
  width: 58%;
}

.panel-placeholder span:nth-child(4) {
  width: 88%;
}

/* ==========================================================
   16. AI PANEL SCAN
========================================================== */

.ai-panel-scan {
  position: absolute;
  z-index: 5;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  pointer-events: none;

  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(237, 41, 57, 0.02) 30%,
    rgba(237, 41, 57, 0.26) 50%,
    rgba(237, 41, 57, 0.02) 70%,
    transparent 100%
  );

  opacity: 0;
}

/* ==========================================================
   17. TECHNOLOGY BADGES + CTA
========================================================== */

.hero-extras {
  position: relative;
  z-index: 9;

  width: min(63%, 900px);

  display: flex;
  flex-direction: column;

  align-items: flex-start;

  gap: clamp(14px, 2vh, 25px);
  margin-top: clamp(8px, 1.5vh, 20px);
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 9px;
}

.hero-tech span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 35px;
  padding: 8px 14px;

  border: 1px solid rgba(237, 41, 57, 0.34);
  border-radius: 8px;

  background: rgba(20, 20, 23, 0.55);

  color: #e5e5e8;

  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.035em;

  white-space: nowrap;
}

.hero-tech span:first-child {
  color: var(--hero-red-light);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 12px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 20px;

  min-height: 50px;
  padding: 13px 24px;

  border-radius: 10px;

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;

  text-decoration: none;

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

.hero-actions a:hover {
  transform: translateY(-3px);
}

.hero-action-primary {
  background: var(--hero-red);
  border: 1px solid var(--hero-red);

  color: #fff;

  box-shadow: 0 10px 35px rgba(237, 41, 57, 0.16);
}

.hero-action-primary:hover {
  background: #ff3448;
}

.hero-action-secondary {
  background: rgba(18, 18, 20, 0.6);

  border: 1px solid rgba(237, 41, 57, 0.48);

  color: #fff;
}

.hero-action-secondary:hover {
  background: rgba(237, 41, 57, 0.12);
  border-color: var(--hero-red);
}

/* ==========================================================
   18. BOTTOM PROGRESS BAR
========================================================== */

.build-footer {
  position: relative;
  z-index: 20;

  width: 100%;
  height: 62px;
  flex-shrink: 0;

  display: flex;
  align-items: center;

  gap: 22px;

  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.build-footer > span {
  font-family: monospace;
  font-size: 10px;
  font-weight: 600;

  letter-spacing: 0.12em;

  color: #a8a8ae;
  white-space: nowrap;
}

.build-progress {
  position: relative;

  flex: 1;
  height: 2px;

  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
}

.build-progress-fill {
  width: 100%;
  height: 100%;

  background: var(--hero-red);

  transform: scaleX(0);
  transform-origin: left center;
}

.build-percentage {
  min-width: 45px;

  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   19. ANIMATION COMPATIBILITY
========================================================== */

.ai-text-reveal {
  will-change: transform, opacity;
}

.build-panel,
.build-hero-image,
.build-title-area,
.hero-tech,
.hero-actions,
.hero-orbit {
  backface-visibility: hidden;
}

.hero-section a:focus-visible {
  outline: 2px solid var(--hero-red);
  outline-offset: 5px;
}

/* ==========================================================
   20. DESKTOP HEIGHT ADJUSTMENTS
========================================================== */

@media (min-width: 1101px) and (max-height: 850px) {
  .hero-editorial {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .build-title-area {
    margin-top: 20px;
    margin-bottom: 10px;
  }

  .build-title {
    font-size: clamp(55px, 6.6vw, 120px);
  }

  .build-content {
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .build-panel {
    min-height: 90px;
  }

  .hero-extras {
    gap: 12px;
    margin-top: 8px;
  }

  .hero-tech span {
    min-height: 31px;
    padding: 6px 11px;
  }

  .hero-actions a {
    min-height: 43px;
    padding: 10px 20px;
  }
}

/* ==========================================================
   21. TABLET
========================================================== */

@media (max-width: 1100px) {
  .build-header-meta {
    display: none;
  }

  .build-title-area {
    width: 68%;
  }

  .build-title {
    font-size: clamp(55px, 8vw, 100px);
  }

  .build-hero-image {
    width: 47vw;
    right: -5%;
  }

  .hero-orbit {
    width: 57vw;
    right: -8%;
  }

  .build-content {
    width: 65%;
  }

  .hero-extras {
    width: 68%;
  }
}

/* ==========================================================
   22. MOBILE / SMALL TABLET
========================================================== */

@media (max-width: 768px) {
  .hero-section {
    min-height: 680px;
  }

  .hero-stage {
    --hero-edge: 20px;
  }

  .build-header {
    height: 70px;
  }

  .build-logo {
    font-size: 29px;
  }

  .build-nav {
    gap: 13px;
  }

  .build-nav a {
    font-size: 10px;
  }

  .build-nav a:nth-child(2),
  .build-nav a:nth-child(3) {
    display: none;
  }

  .hero-editorial {
    justify-content: flex-start;

    padding-top: 40px;
    padding-bottom: 12px;
  }

  .hero-side-index {
    top: 16px;
    font-size: 9px;
  }

  .build-title-area {
    width: 100%;

    margin-top: 12px;
    margin-bottom: 14px;
  }

  .build-title {
    font-size: clamp(48px, 11.7vw, 89px);
    line-height: 0.9;
  }

  .title-coordinate {
    font-size: 8px;
  }

  .title-guide-top {
    top: -10px;
  }

  .title-guide-bottom {
    bottom: -10px;
  }

  .build-hero-image {
    right: -5%;
    bottom: 20%;

    width: min(67vw, 410px);
    height: 58%;
  }

  .hero-orbit {
    top: 48%;
    right: -22%;

    width: 78vw;
  }

  .build-content {
    width: 62%;

    grid-template-columns: 1fr;
    gap: 6px;

    margin-top: 12px;
    margin-bottom: 8px;
  }

  .build-panel {
    min-height: 70px;
    padding: 8px 0 8px 12px;
  }

  .build-panel h2 {
    font-size: clamp(22px, 4.3vw, 32px);
  }

  .build-panel p {
    font-size: 11px;
    line-height: 1.45;
  }

  .build-eyebrow {
    font-size: 8px;
    margin-bottom: 6px;
  }

  .hero-extras {
    width: 100%;

    margin-top: auto;
    gap: 12px;
  }

  .hero-tech {
    gap: 6px;
  }

  .hero-tech span {
    min-height: 29px;

    padding: 6px 9px;
    font-size: 9px;
  }

  .hero-actions a {
    min-height: 42px;
    padding: 10px 15px;

    font-size: 10px;
  }

  .build-footer {
    height: 46px;
    gap: 12px;
  }

  .build-footer > span {
    font-size: 8px;
  }

  .hero-image-label {
    display: none;
  }
}

/* ==========================================================
   23. SMALL MOBILE
========================================================== */

@media (max-width: 480px) {
  .hero-stage {
    --hero-edge: 16px;
  }

  .build-nav a:last-child {
    display: none;
  }

  .build-title {
    font-size: 11.4vw;
  }

  .hero-editorial {
    padding-top: 36px;
  }

  .build-hero-image {
    width: 73vw;
    height: 48%;

    right: -15%;
    bottom: 24%;
  }

  .hero-orbit {
    width: 96vw;
    right: -33%;
    top: 49%;
  }

  .build-content {
    width: 72%;
  }

  .build-panel h2 {
    font-size: 21px;
  }

  .build-panel p {
    font-size: 10px;
  }

  .hero-tech span {
    font-size: 8px;
    padding: 6px 8px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions a {
    padding: 10px 12px;
    gap: 8px;
  }
}

/* ==========================================================
   24. REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {
  .blueprint-grid {
    opacity: 0.08;
  }

  .guide,
  .title-guide,
  .title-coordinate,
  .panel-placeholder,
  .ai-panel-scan {
    display: none;
  }

  .build-progress-fill {
    transform: scaleX(1);
  }

  .hero-actions a {
    transition: none;
  }
}

/* ==========================================
   AI TYPING — EDITORIAL HERO
========================================== */

.hero-section .panel-real-content {
  overflow: visible;
}

.hero-section .ai-typing-active {
  position: relative;
}

/* Cursor-like typing indicator */

.hero-section
.panel-real-content
.ai-typing-active::after {
  content: "";

  display: inline-block;

  width: 2px;
  height: 0.85em;

  margin-left: 4px;

  background: #ed2939;

  vertical-align: -0.08em;

  animation: heroTypingCaret 0.65s
    steps(1, end) infinite;
}

@keyframes heroTypingCaret {
  0%, 49% {
    opacity: 1;
  }

  50%, 100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section
  .ai-typing-active::after {
    animation: none;
  }
}
