/* ==========================================================================
   Home page — hero, marquee, about, timeline, projects, skills, contact
   Depends on css/site.css

   Layout principle: no cards. Structure comes from whitespace, hairlines and
   a real type scale. The accent appears on links and one CTA, nowhere else.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: calc(var(--nav-h) + 5rem) 0 4.5rem; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.25fr .75fr;
  gap: 4rem; align-items: center;
}

.hero h1 {
  font-size: var(--fs-display); font-weight: 800;
  letter-spacing: -.045em; line-height: 1.02; margin: 1.35rem 0 0;
}
.hero h1 .accent { color: var(--accent); }
.hero-lede {
  font-size: var(--fs-lede); color: var(--ink-2);
  max-width: 34rem; margin-top: 1.5rem; line-height: 1.72;
}
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2.25rem; }

.hero-social { display: flex; align-items: center; gap: .35rem; margin-top: 2.5rem; }
.hero-social .label {
  font-family: var(--mono);
  font-size: var(--fs-meta); font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-4); margin-right: .7rem;
}
.hero-social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-3); font-size: 1rem; text-decoration: none;
  transition: color .22s var(--ease-soft);
}
.hero-social a:hover { color: var(--accent); }

/* Portrait — a real photograph, so it keeps its frame and depth */
.portrait { position: relative; justify-self: center; width: 100%; max-width: 340px; }
.portrait-frame {
  position: relative; border-radius: 20px; overflow: hidden;
  background: var(--surface); box-shadow: var(--sh-lg); aspect-ratio: 4 / 5;
}
.portrait-frame picture { display: block; width: 100%; height: 100%; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.portrait-frame::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28, 25, 23, .6) 0%, rgba(28, 25, 23, .06) 42%, transparent 70%);
}
.portrait-caption { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.1rem; z-index: 2; color: #fff; }
.portrait-caption .name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.portrait-caption .role { font-size: .78rem; opacity: .88; display: flex; align-items: center; gap: .4rem; margin-top: .1rem; }

.stat-chip {
  position: absolute; right: -18px; top: 12%; z-index: 3;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: .7rem .95rem;
  box-shadow: var(--sh-md); display: flex; align-items: center; gap: .65rem;
}
.stat-chip i { color: var(--accent); font-size: 1rem; }
.stat-chip .v { font-weight: 800; font-size: .95rem; letter-spacing: -.02em; line-height: 1.1; }
.stat-chip .k { font-size: .68rem; color: var(--ink-3); font-weight: 500; }

/* Stats — hairline rules, no boxes */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 4.5rem; border-top: 1px solid var(--line);
}
.stat { padding: 1.75rem 1.5rem 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .num {
  font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 800; letter-spacing: -.04em;
  color: var(--ink); line-height: 1.05;
}
.stat .cap {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-3);
  margin-top: .45rem; letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   Tech marquee
   -------------------------------------------------------------------------- */
.marquee {
  border-block: 1px solid var(--line); background: none;
  padding: 1.1rem 0; overflow: hidden; position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 2.75rem; width: max-content; animation: slide 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
  font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--ink-4);
  letter-spacing: .02em; transition: color .2s;
}
.marquee-item:hover { color: var(--ink-2); }
.marquee-item i { font-size: .9rem; }
@keyframes slide { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 4.5rem; align-items: start; }
.about-copy p { color: var(--ink-2); font-size: var(--fs-lede); line-height: 1.8; margin-bottom: 1.25rem; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: var(--ink); font-weight: 600; }
.about-copy a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.about-copy a:hover { border-color: var(--accent); }

/* Facts — a definition list, separated by hairlines */
.facts { display: grid; border-top: 1px solid var(--line); }
.fact {
  display: block; padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}
.fact h4 {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-4);
  margin-bottom: .3rem;
}
.fact p { font-size: var(--fs-small); color: var(--ink); line-height: 1.6; }
.fact-star h4 { color: var(--accent); }
.fact-star p { font-weight: 600; }

/* --------------------------------------------------------------------------
   Timeline — the date is the left column, so the rail carries information
   -------------------------------------------------------------------------- */
.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 10.5rem 1fr; gap: 2.5rem;
  padding: 2.5rem 0; border-bottom: 1px solid var(--line);
}
.job-when {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  color: var(--ink-3); letter-spacing: .03em; line-height: 1.6;
  padding-top: .5rem;
}
.job-id { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.15rem; }
.job-logo {
  width: 34px; height: 34px; flex: none; border-radius: 8px; object-fit: contain;
  background: var(--bg-alt); padding: 4px;
}
.job h3 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
.job .org { font-size: var(--fs-small); color: var(--ink-3); font-weight: 500; margin-top: .1rem; }
.job ul { list-style: none; margin-bottom: 1.35rem; }
.job li {
  position: relative; padding-left: 1.15rem; margin-bottom: .6rem;
  font-size: var(--fs-body); color: var(--ink-2); line-height: 1.68;
}
.job li::before {
  content: ''; position: absolute; left: 0; top: .72em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong);
}
.job li:last-child { margin-bottom: 0; }
.job li em { color: var(--ink); font-style: italic; }
.job li strong { color: var(--ink); font-weight: 600; }

/* The one line worth reading first */
.job li.star { color: var(--ink); font-weight: 600; }
.job li.star::before {
  content: '★'; background: none; width: auto; height: auto;
  left: -.05em; top: .1em; color: var(--accent); font-size: .82rem; line-height: 1;
}

/* --------------------------------------------------------------------------
   Projects — a list, not a card grid, so nothing is orphaned
   -------------------------------------------------------------------------- */
/* Three across so the featured row plus three projects fills exactly, with
   no orphaned cell. */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 3rem; border-top: 1px solid var(--line); }
.project {
  padding: 2.25rem 0; display: flex; flex-direction: column; position: relative;
  border-bottom: 1px solid var(--line);
}
.project.is-featured { grid-column: 1 / -1; }

.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.project-idx {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  color: var(--ink-4); letter-spacing: .12em;
}
.project h3 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.025em; margin-bottom: .6rem; }
.project p { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.72; margin-bottom: 1.35rem; flex: 1; }
.project .tags { margin-bottom: 1.35rem; }
.project-link {
  display: inline-flex; align-items: center; gap: .45rem; margin-top: auto;
  font-size: var(--fs-small); font-weight: 600; color: var(--accent); text-decoration: none;
  transition: gap .22s var(--ease);
}
.project-link:hover { gap: .8rem; }
.project-note {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-4);
  margin-top: auto; letter-spacing: .04em;
}

.featured-body { display: grid; grid-template-columns: 1fr 300px; gap: 3.5rem; align-items: center; }
.featured-visual { margin: 0; color: var(--accent); }
.featured-visual svg { width: 100%; height: auto; }
.featured-visual .tp-node rect { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.featured-visual .tp-node text {
  fill: var(--ink); font-family: var(--mono); font-size: 11px;
  text-anchor: middle; letter-spacing: .04em;
}
.featured-visual .tp-flow path { fill: none; stroke: currentColor; stroke-width: 1.2; }
.featured-visual .tp-tap path { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.featured-visual .tp-store rect { fill: var(--bg-alt); stroke: none; }
.featured-visual .tp-store text {
  fill: var(--ink-2); font-family: var(--mono); font-size: 11px;
  text-anchor: middle; letter-spacing: .04em;
}
.featured-visual .tp-store .tp-sub { fill: var(--ink-4); font-size: 9px; }

/* --------------------------------------------------------------------------
   Skills — plain columns, uneven heights are fine without borders
   -------------------------------------------------------------------------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 3rem; }
.skill { padding: 0; }
.skill h4 {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-4);
  padding-bottom: .8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.skill .tags { gap: .5rem 1.1rem; }
.skill .tag { font-size: var(--fs-small); font-family: var(--sans); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Achievements — a numbered run of facts
   -------------------------------------------------------------------------- */
.achv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.achv { padding: 1.75rem 1.75rem 1.75rem 0; }
.achv + .achv { padding-left: 1.75rem; border-left: 1px solid var(--line); }
.achv h4 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.025em; margin-bottom: .5rem; line-height: 1.2; }
.achv p { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.65; }
.achv-lead h4 { color: var(--accent); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-panel {
  background: none; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; padding: 4.5rem 0 0; text-align: center;
  position: relative; box-shadow: none;
}
.contact-panel h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -.038em; line-height: 1.08; }
.contact-panel p { color: var(--ink-2); max-width: 34rem; margin: 1.1rem auto 0; line-height: 1.75; font-size: var(--fs-lede); }
.contact-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 2.25rem; }
.contact-links {
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.contact-links a {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-small); font-weight: 500; color: var(--ink-3); text-decoration: none;
  transition: color .2s var(--ease-soft);
}
.contact-links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .portrait { max-width: 300px; order: -1; justify-self: start; }
  .stat-chip { right: -14px; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .achv-grid { grid-template-columns: repeat(2, 1fr); }
  .achv, .achv + .achv { padding: 1.5rem 1.5rem 1.5rem 0; border-left: 0; }
  .achv:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--line); }
  .achv:nth-child(n+3) { border-top: 1px solid var(--line); }
  .featured-body { grid-template-columns: 1fr; gap: 2rem; }
  .projects { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: .9rem; }
  .job-when { padding-top: 0; }
}
@media (max-width: 700px) {
  .hero { padding-top: calc(var(--nav-h) + 2rem); }
  .hero-grid { gap: 2.25rem; }

  /* Phone hero: the photo stops being a hero image and becomes a byline
     avatar, so the headline is the first thing on screen rather than the
     fifth. display:contents lifts the text block's children into the grid
     so the avatar can share a row with the status pill. */
  .hero-grid { grid-template-columns: auto 1fr; gap: 0 .85rem; align-items: center; }
  .hero-grid > div:first-child { display: contents; }

  .portrait { grid-column: 1; grid-row: 1; width: 58px; max-width: 58px; }
  .portrait-frame {
    aspect-ratio: 1 / 1; border-radius: 50%;
    box-shadow: none; border: 1px solid var(--line);
  }
  .portrait-frame img { object-position: center; }
  .portrait-frame::after,
  .portrait-caption,
  .stat-chip { display: none; }

  .hero .pill { grid-column: 2; grid-row: 1; justify-self: start; }
  .hero h1,
  .hero-lede,
  .hero-actions,
  .hero-social { grid-column: 1 / -1; }
  .hero h1 { margin-top: 1.6rem; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 1.4rem 1rem 1.4rem 0; }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { padding-left: 1.25rem; border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); padding-top: 1.4rem; }
  .projects { grid-template-columns: 1fr; gap: 0; }
  .skills { grid-template-columns: 1fr; gap: 2rem; }
  .achv-grid { grid-template-columns: 1fr; }
  .achv, .achv + .achv, .achv:nth-child(even) { padding: 1.4rem 0; border-left: 0; }
  .achv + .achv { border-top: 1px solid var(--line); }
  .contact-links { gap: 1.15rem; }
}
@media (max-width: 400px) {
  .stat-chip { padding: .55rem .8rem; }
}

@media (pointer: coarse) {
  .hero-social a { width: 44px; height: 44px; }
  .contact-links a,
  .project-link { min-height: 44px; display: inline-flex; align-items: center; }
}
