/* ============================================================
   sections.css — hero, about, skills, fusion, contact, author
   ============================================================ */

/* ══════════ HERO ══════════
   The one place with a background: a faint crystal-lattice motif —
   the close-packed atomic plane that underlies metallurgy. It sits
   at ~4% opacity so it reads as texture, never decoration.        */

.hero {
  position: relative;
  padding: 78px 0 64px;
  border-top: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 46px;
  align-items: center;
}
/* Set when rotating.png is absent, so the empty track disappears. */
.hero-grid.no-model { grid-template-columns: minmax(0, 1fr); }

/* ── plain entrance, for the pieces that simply rise ── */
.anim {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .68s cubic-bezier(.22, .9, .3, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ══════════ LEFT-TO-RIGHT REVEAL ══════════
   The line is clipped to nothing and the clip opens toward the right,
   so the words are uncovered in reading order. A thin copper edge
   travels with the boundary, which is what makes it read as a sweep
   rather than a fade. */
.wipe {
  display: block;
  position: relative;
  clip-path: inset(0 100% -0.25em 0);
  animation: wipe-lr 1s cubic-bezier(.62, .02, .2, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes wipe-lr {
  to { clip-path: inset(0 -0.4em -0.25em 0); }
}

.wipe::after {
  content: '';
  position: absolute;
  top: .08em; bottom: .12em;
  left: 0;
  width: 2px;
  background: var(--copper-500);
  opacity: 0;
  animation: wipe-edge 1s cubic-bezier(.62, .02, .2, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes wipe-edge {
  0%        { left: 0;    opacity: 0; }
  8%        { opacity: 1; }
  92%       { opacity: 1; }
  100%      { left: 100%; opacity: 0; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 6px;
  border: var(--bw-bold) solid var(--line);
  border-radius: 999px;
  background: var(--page);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 22px;
  box-shadow: var(--shadow-1);
}
.hero-eyebrow img { height: 18px; width: auto; }
.hero-eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--copper-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper-500) 20%, transparent);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper-500) 20%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--copper-500) 0%, transparent); }
}

/* ══════════ NAME ══════════ */
.hero-name {
  font-size: clamp(38px, 6vw, 60px);
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.06;
}
.hero-name .wipe:first-child {
  font-family: var(--font-sans);
  font-size: .38em;
  font-weight: 400;
  letter-spacing: -.008em;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.hero-first {
  background: linear-gradient(96deg,
    var(--ink) 8%, var(--steel-600) 46%, var(--copper-600) 76%, var(--ink) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    wipe-lr 1s cubic-bezier(.62, .02, .2, 1) forwards,
    sheen 8s ease-in-out infinite;
  animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 1s);
}
@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-tagline {
  margin-top: 20px;
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.3vw, 20px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { font-size: 12px; color: var(--copper-500); }
.hero-meta a { border-bottom: 1px solid transparent; transition: all .18s var(--ease); }
.hero-meta a:hover { color: var(--copper-600); border-bottom-color: var(--copper-200); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ══════════ ROTATING IMAGE ══════════ */
.hero-model { display: flex; justify-content: center; }

.spin-stage {
  position: relative;
  width: 280px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
/* A faint plate behind it, so a transparent PNG still has a footing. */
.spin-stage::before {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%,
    color-mix(in srgb, var(--copper-500) 8%, transparent) 0%,
    transparent 68%);
}

#rotating-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: spin-slow 9s linear infinite;   /* config.rotateSeconds overrides this */
  transform-origin: 50% 50%;
  will-change: transform;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }



/* ══════════ STATS ══════════ */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: var(--bw);
  margin-top: 48px;
  background: var(--line);
  border: var(--bw-bold) solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hero-stats:empty { display: none; }

.stat {
  background: var(--page);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background .2s var(--ease);
}
.stat:hover { background: var(--surface); }
.stat-n {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-l { font-size: 11px; color: var(--ink-3); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-model { order: -1; justify-content: flex-start; }
  .spin-stage { width: 190px; }
  .hero { padding: 44px 0 48px; }
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px 13px; }
  .stat-n { font-size: 22px; }
}

/* ══════════ ABOUT ══════════ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 46px;
  align-items: start;
}
.about-text { font-size: 15.5px; color: var(--ink-2); line-height: 1.78; }
.about-text strong { color: var(--ink); }

.about-side { position: sticky; top: 28px; }

/* The photo keeps its own proportions — no forced ratio, no crop.
   The frame adapts to whatever shape the file happens to be. */
.about-figure {
  border-radius: var(--r-md);
  border: var(--bw-bold) solid var(--line);
  background: var(--surface-2);
  padding: 6px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.about-figure:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.about-photo {
  display: block;
  width: 100%;
  height: auto;              /* natural aspect ratio — nothing is cut off */
  border-radius: calc(var(--r-md) - 4px);
}

.about-facts {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: var(--bw) solid var(--line-soft);
  font-size: 12.5px;
}
.fact:last-child { border-bottom: none; }
.fact dt { color: var(--ink-4); }
.fact dd { color: var(--ink); font-weight: 500; text-align: right; }

/* ── focus chips ── */
.focus-wrap { margin-top: 30px; }
.focus-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.focus-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  background: var(--page);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all .22s var(--ease);
}
.chip::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--copper-500);
  opacity: .6;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.chip:hover {
  border-color: var(--copper-200);
  background: var(--copper-050);
  color: var(--ink);
  transform: translateY(-2px);
}
.chip:hover::before { opacity: 1; transform: scale(1.3); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .about-side { position: static; max-width: 260px; }
}

/* ══════════ SKILLS ══════════
   Horizontal meters — easier to compare than a row of dials.      */
.skill-list { display: flex; flex-direction: column; gap: 3px; }

.skill {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 84px;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: var(--bw) solid var(--line-soft);
}
.skill:last-child { border-bottom: none; }
.skill-name { font-size: 14px; font-weight: 500; }

.skill-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--steel-600), var(--copper-500));
  transition: width 1s var(--ease);
}

.skill-tag {
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
  font-family: var(--font-mono);
}

@media (max-width: 560px) {
  .skill { grid-template-columns: 1fr 64px; gap: 8px 12px; }
  .skill-track { grid-column: 1 / -1; }
  .skill-tag { text-align: right; }
}

/* ══════════ FUSION / YOUTUBE ══════════ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}
.video-grid iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: var(--bw-bold) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.link-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

/* ══════════ CONTACT ══════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 42px;
  align-items: start;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 28px; } }

.contact-card {
  border: var(--bw-bold) solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  background: var(--surface);
}
.contact-line {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 0;
  border-bottom: var(--bw) solid var(--line-soft);
  font-size: 13.5px;
}
.contact-line:last-child { border-bottom: none; }
.contact-line i { color: var(--copper-500); font-size: 12.5px; margin-top: 4px; width: 14px; }
.contact-line a { color: var(--ink); word-break: break-word; }
.contact-line a:hover { color: var(--copper-600); }
.contact-line small { display: block; color: var(--ink-4); font-size: 11px; }

/* ══════════ AUTHOR PANEL ══════════ */
.author-panel {
  border: var(--bw-bold) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 20px;
}
.author-panel h3 { font-size: 16px; margin-bottom: 4px; }
.author-panel > p { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  background: var(--page);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .16s var(--ease);
  text-align: left;
}
.toggle:hover { border-color: var(--steel-200); }
.toggle-switch {
  width: 30px; height: 17px;
  border-radius: 999px;
  background: var(--steel-200);
  position: relative;
  flex-shrink: 0;
  transition: background .2s var(--ease);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s var(--ease);
}
.toggle.on .toggle-switch { background: var(--ok); }
.toggle.on .toggle-switch::after { transform: translateX(13px); }

.author-actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* Diagnostics readout */
.diag {
  margin-top: 18px;
  border: var(--bw-bold) solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: none;
}
.diag.open { display: block; }
.diag-row {
  display: grid;
  grid-template-columns: 116px 66px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--page);
  align-items: baseline;
}
.diag-row:last-child { border-bottom: none; }
.diag-row.head { background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.diag-key { color: var(--ink); }
.diag-count { color: var(--ink-3); }
.diag-files {
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diag-row.bad .diag-count { color: var(--error); }
.diag-row.warn .diag-count { color: var(--warn); }
.diag-row.good .diag-count { color: var(--ok); }
.diag-note {
  padding: 10px 12px;
  background: var(--copper-050);
  color: var(--copper-700);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid var(--copper-200);
}

@media (max-width: 620px) {
  .diag-row { grid-template-columns: 1fr 54px; }
  .diag-files { grid-column: 1 / -1; }
}

/* ══════════ FOOTER ══════════ */
.footer {
  border-top: var(--bw-bold) solid var(--line);
  padding: 32px 0 44px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-4);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--copper-600); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* Back to top */
#to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: var(--bw-bold) solid var(--line);
  border-radius: 50%;
  background: var(--page);
  color: var(--ink-2);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all .24s var(--ease);
  z-index: 300;
}
#to-top.show { opacity: 1; pointer-events: auto; transform: none; }
#to-top:hover { color: var(--copper-600); border-color: var(--copper-200); }

@media (max-width: 560px) {
  #to-top { right: 16px; bottom: 76px; }
}

/* ============================================================
   HERO STATS
   ============================================================ */
.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px;
  margin-top: 38px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hero-stats:empty { display: none; }

.stat {
  background: var(--page);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-n {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-l {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .01em;
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px 13px; }
  .stat-n { font-size: 22px; }
}
