.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: max(680px, 100svh);
  display: flex;
  padding-top: calc(var(--header-live, var(--header-h)) + env(safe-area-inset-top, 0px) + clamp(24px, 5.7vh, 62px));
  padding-bottom: clamp(20px, 3.7vh, 36px);
  background: linear-gradient(#6aa8d9 0%, #c6d9e7 53%, #46a2b1 63%, #f4e6d2 77%, var(--bg) 100%);
}

.hero-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-scene .gl, .hero-scene .poster, .hero-scene .coast-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}

.hero-scene .gl, .hero-scene .coast-video { opacity: 0; transition: opacity .45s ease; }
.hero-scene.video-ready .coast-video,
.hero-scene.gl-ready .gl { opacity: 1; }

.hero-scene::after, .scene-fade {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 85%, #edf5fa21 91%, var(--bg));
}

.scene-fade {
  background: linear-gradient(to bottom, transparent 22%, #edf5fa47 57%, var(--bg) 98%);
  opacity: calc(var(--scene-exit, 0) * .86);
}

.hero-inner {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(100%, 39rem));
  grid-template-rows: auto 1fr auto;
  gap: 12px 22px;
  align-items: start;
  max-width: 1320px;
}

.hero-copy {
  position: relative;
  isolation: isolate;
  grid-column: 2;
  justify-self: end;
  width: 100%;
  color: var(--text);
  padding: clamp(8px, 1.2vw, 18px) 0 10px clamp(10px, 2vw, 28px);
  text-shadow: 0 1px 5px #f4fcffba;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -92px -250px -82px -88px;
  background: radial-gradient(ellipse farthest-side at 57% 45%, #f1fafce8 20%, #f2fafbd3 45%, #edf8fa87 66%, #edf8fa40 84%, transparent 100%);
  pointer-events: none;
}

.hero-id {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-id .name { font: 700 1.2rem/1.4 var(--font-serif); }
.hero-id .role { font-weight: 700; font-size: .78rem; letter-spacing: .13em; }

.hero h1 {
  font: 700 clamp(1.85rem, 3vw, 2.9rem)/1.35 var(--font-serif);
  letter-spacing: .012em;
  text-wrap: initial;
}

.hero h1 .line { display: block; }
.hero h1 .ph { display: inline-block; }
.hero h1 .line + .line { color: var(--brand); }
.hero:lang(en) h1 { font-size: clamp(1.85rem, 2.6vw, 2.3rem); text-wrap: balance; }
.hero-intro { margin-top: 16px; max-width: 31em; font-size: clamp(.96rem, 1.23vw, 1.13rem); line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 21px; }
.hero-actions .btn { text-shadow: none; }
.hero-actions .btn-secondary { background: #f9fcfeee; }
.hero-actions .btn-secondary:hover { background: var(--soft); }

.hero-skills {
  grid-area: 3 / 2;
  justify-self: end;
  align-self: end;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-skills li {
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.5;
}

.hero-bottom { grid-area: 3 / 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; }
.scene-scroll, .motion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font: 700 .82rem/1.1 var(--font-sans);
}
.scene-scroll { text-decoration: none; }
.scene-scroll:hover, .motion-btn:hover { background: var(--soft); color: var(--brand-hover); }
.scene-scroll svg, .motion-btn svg { width: 15px; height: 15px; flex: none; }
.motion-btn { border: 1px solid var(--line-strong); cursor: pointer; }
.motion-note { padding: 5px 11px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: .82rem; }

@media (min-width: 768px) and (max-aspect-ratio: 5/4) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, min(100%, 34rem)); }
}

@media (max-width: 767px) {
  .hero {
    min-height: max(620px, 100svh);
    padding-top: calc(var(--header-live, var(--header-h)) + env(safe-area-inset-top, 0px) + 25px);
    padding-bottom: 12px;
  }
  .hero-inner { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(205px, 1fr) auto; gap: 10px; }
  .hero-copy { grid-area: 1 / 1; max-width: 31rem; justify-self: start; padding: 0; }
  .hero-copy::before {
    inset: -45px -64px -85px;
    background: linear-gradient(160deg, #edf8fbe8 17%, #eef9fae0 51%, #edf8f9a0 72%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 75%, transparent);
  }
  .hero-id { display: none; }
  .hero h1 { font-size: clamp(1.42rem, 6.45vw, 2.15rem); line-height: 1.44; }
  .hero:lang(en) h1 { font-size: clamp(1.1875rem, 5.7vw, 2.15rem); }
  .hero-intro { margin-top: 12px; font-size: .97rem; line-height: 1.58; }
  .hero-actions { margin-top: 14px; }
  .hero-actions .btn { min-height: 44px; padding-inline: 12px; font-size: .92rem; }
  .hero-skills { grid-area: 2 / 1; justify-self: start; }
  .hero-skills li { padding: 2px 7px; font-size: .7rem; }
  .hero-bottom { grid-area: 4 / 1; justify-content: space-between; gap: 4px; }
  .hero-scene::after { background: linear-gradient(to bottom, transparent 84%, #edf5fa33 90%, var(--bg)); }
}

@media (max-width: 360px) {
  .hero { padding-top: calc(var(--header-live, var(--header-h)) + env(safe-area-inset-top, 0px) + 18px); }
  .hero-inner { grid-template-rows: auto auto minmax(165px, 1fr) auto; }
  .hero h1 { font-size: 1.28rem; }
  .hero-intro { font-size: .91rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scene .gl, .hero-scene .coast-video { transition: none; }
}

.rm-sim .hero-scene .gl, .rm-sim .hero-scene .coast-video { transition: none; }
