/* ---------- Panels ---------- */

main {
  position: relative;
  z-index: 2;
}

.panel {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem clamp(1rem, 5vw, 3rem) 5rem;
}

/* The 3D wordmark occupies the upper-middle of the hero, so the copy sits
   below it rather than on top of it. portfolio.js lifts the cloud to match. */
.panel--hero {
  text-align: center;
  gap: 0.35rem;
  justify-content: flex-end;
  padding-bottom: clamp(3rem, 9vh, 6rem);
}

/* The 3D scene renders the name, so the DOM h1 is for assistive tech and
   search engines. It becomes visible if WebGL is unavailable. */
.panel--hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}

body:not(.scene-ready) .panel--hero h1,
body.no-webgl .panel--hero h1 {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
  overflow: visible;
  font-size: clamp(2.5rem, 11vw, 7rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  background: linear-gradient(180deg, var(--fg), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* An opaque reading surface shields the introduction during scroll morphs.
   The feathered edge blends into the scene without relying on blur support. */
.hero-intro {
  position: relative;
  isolation: isolate;
  max-width: 100%;
}

.hero-intro::before {
  content: "";
  position: absolute;
  inset: -1rem -1.25rem;
  z-index: -1;
  background: var(--bg);
  box-shadow: 0 0 24px 18px var(--bg);
  border-radius: 1rem;
  pointer-events: none;
}

.hero-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(0.8rem, 1.8vw, 1.05rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-tagline {
  max-width: 34ch;
  margin: 1.25rem auto 0;
  color: var(--fg-dim);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--fg);
  background: var(--sunken);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-ink);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--accent-hi);
}

.scroll-hint {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--fg-dim);
  animation: bob 2.4s var(--ease) infinite;
}

@keyframes bob {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(6px);
  }
}

/* ---------- Cards ---------- */

.panel-card {
  position: relative;
  width: 100%;
  max-width: 44rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
}

/* Corner brackets, as though the panel were a framed readout. */
.panel-card::before,
.panel-card::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.7;
  pointer-events: none;
}

.panel-card::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.panel-card::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

/* Reveal with a separate mask so the permanent corner clipping never changes. */
.panel-card {
  mask-image: linear-gradient(#000, #000);
  mask-position: top center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}
.panel-pending { mask-size: 1% 2px; }
.panels-booting .panel-card,
.panel-card.panel-pending { opacity: 0; }
.instrument-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke-linejoin: bevel;
}
.frame-outline { stroke: var(--accent); stroke-width: 2; opacity: 0.75; }
.frame-inner { stroke: var(--line); stroke-width: 1; }
.frame-marks { stroke: var(--accent); stroke-width: 3; opacity: 0.65; }
.panel-instrument {
  border-color: transparent;
  border-radius: 0;
  padding-top: clamp(3rem, 5vw, 4rem);
  clip-path: polygon(0 28px, 28px 0, calc(100% - 30px) 0, 100% 30px, 100% calc(100% - 34px), calc(100% - 34px) 100%, 24px 100%, 0 calc(100% - 24px));
}
.panel-instrument::before, .panel-instrument::after { display: none; }
.panel-instrument > .eyebrow {
  border: 1px solid var(--line);
  background: var(--sunken);
  color: var(--accent);
  padding: 0.3rem 0.65rem;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
#work .frame-outline { opacity: 0.4; stroke-width: 1; }
#work .frame-marks { opacity: 0.35; }
.panel-instrument.panel-pending { mask-size: 1% 2px; }
.panel-scan {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 -6px 16px 2px var(--glow);
  pointer-events: none;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .panels-booting .panel-card, .panel-card.panel-pending { opacity: 1; }
  .panel-pending, .panel-instrument.panel-pending { mask-size: 100% 100%; }
  .panel-scan { display: none; }
}

.panel-card--wide {
  max-width: var(--max);
}

/* Section eyebrows read as instrument labels on a panel. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "[";
  opacity: 0.5;
}

.eyebrow::after {
  content: "]";
  opacity: 0.5;
}

.panel-card h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.panel-card p {
  color: var(--fg-dim);
  margin: 0 0 1rem;
  max-width: 62ch;
}

/* ---------- Skills ---------- */

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.skill-list li {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--fg);
  background: var(--accent-soft);
}
