/* ── Landing Page Styles ────────────────────────────────────── */

/* Nav logo as link on project pages */
.nav-logo {
  text-decoration: none;
  cursor: pointer;
}
a.nav-logo { color: var(--text); }

.nav-back {
  color: var(--text-dim) !important;
  font-size: 0.85rem !important;
}
.nav-back:hover { color: var(--text) !important; }

/* ── Compact Top-Left Hero ──────────────────────────────────── */
.landing-hero {
  padding: 4rem max(1.5rem, 3vw) 0.4rem;
  max-width: none;
  margin: 0;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  max-width: none;
  width: 100%;
}
.hero-content {
  flex: 1 1 auto;
  max-width: 700px;
}
.hero-tag {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--accent-phosphor);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero-title {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 0.55rem;
}
.hero-title span {
  color: var(--accent-phosphor);
  text-shadow: 0 0 18px var(--accent-phosphor-glow);
}
.hero-mission {
  font-size: 0.95rem;
  color: var(--text-body);
  max-width: 580px;
  line-height: 1.5;
}
.hero-credential {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* ── Projects Section ───────────────────────────────────────── */
.projects-section {
  background: transparent;
  padding: 0.5rem max(1.5rem, 3vw) 3rem;
}
.projects-container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.projects-header { margin-bottom: 1rem; }
.projects-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}
.section-label {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--accent-phosphor);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Tiles first, then the skills as a full-width band underneath */
.projects-body {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.skill-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem 2rem;
  align-items: start;
}
.skill-column-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem 2rem;
}
.skill-column-label {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--accent-phosphor);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.skill-column-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
}
.skill-group-label {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--accent-phosphor);
  letter-spacing: 0.16em;
  margin-bottom: 0.6rem;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-tag {
  font-size: 0.78rem;
  color: var(--text-tag);
  background: rgba(5, 8, 7, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid var(--border-phosphor-strong);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: border-color var(--transition), background var(--transition);
}
/* Only tags that trace to a project respond to the pointer */
.skill-tag.is-probe { cursor: pointer; }
.skill-tag.is-probe:hover {
  border-color: var(--accent-phosphor);
  background: rgba(74, 222, 128, 0.14);
}
.skill-tag.is-probe:focus-visible {
  outline: 2px solid var(--accent-phosphor);
  outline-offset: 2px;
}

/* ── Bento Grid — uniform tiles ─────────────────────────────── */
/* Five equal tiles: one column on phones, 3 + 2 (centred) on tablets and
   small laptops, one row of five from 1200px up. */
.projects-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
@media (min-width: 701px) {
  .projects-bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .projects-bento .bento-tile { grid-column: span 2; }
  .projects-bento .bento-tile:nth-child(4) { grid-column: 2 / span 2; }
}
@media (min-width: 1200px) {
  .projects-bento { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .projects-bento .bento-tile,
  .projects-bento .bento-tile:nth-child(4) { grid-column: auto; }
}

.bento-tile {
  display: flex;
  flex-direction: column;
  background: rgba(5, 8, 7, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid var(--border-phosphor);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.bento-tile:hover {
  border-color: var(--border-phosphor-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 24px rgba(74, 222, 128, 0.08);
}

/* Fixed-aspect thumb so every tile is the same height regardless of image */
.bento-thumb {
  position: relative;
  background: rgba(13, 24, 20, 0.45);
  border-bottom: 1px solid var(--border-phosphor);
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.bento-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* photos fill the frame, true colours */
  filter: brightness(0.95);
  transition: filter var(--transition), transform var(--transition);
}
/* Renders on a flat background keep their whole outline */
.bento-thumb--contain img { object-fit: contain; }
.bento-tile:hover .bento-thumb img {
  filter: brightness(1.03);
  transform: scale(1.03);
}

/* Title row pins to the bottom so all five tiles line up */
.bento-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.6rem 0.85rem 0.75rem;
}
.bento-meta .bento-row { margin-top: auto; }
.bento-spec {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-phosphor);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}
.bento-context {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted, rgba(255,255,255,0.55));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  opacity: 0.85;
}
.bento-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.bento-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.bento-arrow {
  color: var(--accent-phosphor);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.bento-tile:hover .bento-arrow { transform: translateX(3px); }


/* ── Project Tile ───────────────────────────────────────────── */
.project-tile {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.project-tile:hover {
  border-color: rgba(79,142,247,0.5);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Image container */
.project-tile-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.project-tile-image--contain img {
  object-fit: contain !important;
  filter: brightness(1) !important;
}
.project-tile-image--snowflake {
  background: #367878;
}
.project-tile-image--snowflake img {
  transform: scale(1.15) !important;
}
.project-tile:hover .project-tile-image--snowflake img {
  transform: scale(1.2) !important;
}
.project-tile-image--carbon {
  background: #e6e6e6;
}
.project-tile:hover .project-tile-image--carbon img {
  transform: scale(1.03) !important;
}
.project-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.85);
}
.project-tile:hover .project-tile-image img {
  transform: scale(1.06);
  filter: brightness(0.55);
}

/* Hover overlay — description + tags */
.project-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,5,12,0.92) 0%, rgba(5,5,12,0.55) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem 1.2rem 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  gap: 0.75rem;
}
.project-tile:hover .project-tile-overlay { opacity: 1; }

.project-tile-overlay-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.6;
  margin: 0;
}

.project-tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-tile-tags span {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(79,142,247,0.25);
  border: 1px solid rgba(79,142,247,0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* Tile body — always visible, slim */
.project-tile-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  gap: 1rem;
}

.project-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.project-tile-category {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.project-tile-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-tile-cta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  transition: letter-spacing 0.2s ease, color 0.2s ease;
}
.project-tile:hover .project-tile-cta {
  letter-spacing: 0.1em;
}

/* ── About Section (compact, end of page) ───────────────────── */
.about-section {
  background: transparent;
  padding: 1.5rem max(1.5rem, 3vw) 2rem;
  border-top: 1px solid var(--border-phosphor);
}
.about-container {
  max-width: none;
  margin: 0;
  padding: 0;
}
.about-section h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-text p {
  color: var(--text-body);
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.55;
}
.about-text p:last-child { margin-bottom: 0; }

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border-left: 1px solid var(--border-phosphor);
  padding-left: 1.6rem;
}
.about-meta-row { font-family: var(--font-mono); }
.about-meta-label {
  font-size: 0.66rem;
  color: var(--accent-phosphor);
  letter-spacing: 0.16em;
  margin-bottom: 0.4rem;
}
.about-meta-val {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.about-meta-val a { color: var(--accent-phosphor); text-decoration: none; }
.about-meta-val a:hover { text-decoration: underline; }

/* Experience rows under the About grid: role/org left, summary right */
.about-experience {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-phosphor);
  font-family: var(--font-mono);
}
.exp-row {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-phosphor);
}
.exp-row:last-child { border-bottom: none; padding-bottom: 0; }
.exp-role {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.exp-org {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}
.exp-dates {
  font-size: 0.72rem;
  color: var(--accent-phosphor);
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}
.exp-points {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.55;
}
.exp-points li {
  position: relative;
  padding-left: 1.1rem;
}
.exp-points li + li { margin-top: 0.35rem; }
.exp-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-phosphor);
  opacity: 0.8;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-meta { border-left: none; padding-left: 0; border-top: 1px solid var(--border-phosphor); padding-top: 1.5rem; }
  .exp-row { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (max-width: 700px) {
  .landing-hero { padding: 5rem 1.5rem 0.5rem; }
  .hero-inner { max-width: none; }
}

/* ── Bento tile scan-line sweep on hover (Task 18) ─────────── */
.bento-tile { position: relative; overflow: hidden; }
.bento-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 222, 128, 0.18) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  pointer-events: none;
  z-index: 2;
  transition: transform 0.6s ease;
}
.bento-tile:hover::after {
  transform: translateX(100%);
}

/* ── Bento tile description overlay on hover ─────────────── */
.bento-overlay {
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 4 / 3;       /* same box as .bento-thumb */
  background: rgba(5, 8, 7, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 3;
}
.bento-tile:hover .bento-overlay,
.bento-tile:focus-visible .bento-overlay { opacity: 1; }
.bento-overlay-desc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-body);
  max-width: 100%;
  margin: 0;
  text-align: left;
}
/* The bento-meta should sit above the overlay's bottom-fade so titles stay readable */
.bento-tile .bento-meta {
  position: relative;
  z-index: 4;
}

/* Touch devices can't hover, so the description would never show. There it
   becomes plain text under the title instead of an overlay on the photo.
   Mouse/trackpad devices don't match (hover: none) and keep the hover overlay. */
@media (hover: none) {
  .bento-overlay {
    position: static;
    aspect-ratio: auto;
    order: 1;              /* after .bento-meta in the tile's flex column */
    display: block;
    opacity: 1;
    background: none;
    padding: 0 0.85rem 0.9rem;
    z-index: auto;
  }
  .bento-overlay-desc { font-size: 0.86rem; line-height: 1.5; }
  .bento-tile .bento-meta { padding-bottom: 0.45rem; }
}

/* ── Skill highlight when a project is hovered ───────────── */
.skill-tag {
  transition: border-color var(--transition), background var(--transition),
              box-shadow var(--transition), transform var(--transition), opacity var(--transition),
              color var(--transition);
}
.skill-tag.skill-highlight {
  color: #e8f5ec;
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.7) !important;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.32);
  font-weight: 500;
}
/* Dim the others when any tile is hovered */
.skill-column.is-filtering .skill-tag:not(.skill-highlight) {
  opacity: 0.28;
}


/* Hero CTA row — Resume + Projects buttons stacked on the right of hero */
.hero-cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0;
  flex: 0 0 auto;
  min-width: 220px;
  align-items: stretch;
}
.hero-cta-row .btn-primary,
.hero-cta-row .btn-outline {
  justify-content: center;
}

/* On narrow viewports, drop CTAs to a row below the hero text */
@media (max-width: 800px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }
  .hero-cta-row {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
}

/* ── Skills <-> projects tracing ────────────────────────────── */
/* The readout has its own row with room reserved for its longest message,
   so the tags never move under the pointer when the text changes. */
.skill-readout {
  grid-column: 1 / -1;
  margin: -0.7rem 0 0;
  min-height: 4.5em;            /* three lines */
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}
@media (min-width: 1200px) { .skill-readout { min-height: 3em; } }   /* two lines */
.skill-readout a { color: var(--accent-phosphor); text-decoration: none; }
.skill-readout a:hover { text-decoration: underline; }
.projects-bento .bento-tile { transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition); }
.projects-bento.is-filtering .bento-tile:not(.tile-highlight) { opacity: 0.32; }
.bento-tile.tile-highlight {
  border-color: var(--accent-phosphor);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.45), 0 0 26px rgba(74, 222, 128, 0.18);
}
@media (min-width: 1200px) {
  /* five groups, widths in proportion to how many tags each holds */
  .skill-column { grid-template-columns: 2.3fr 1fr 1.25fr 1fr 1.45fr; }
}

/* ── Home hero: the name leads, credentials sit beside it ───── */
.landing-hero { padding: 6.6rem max(1.5rem, 3vw) 1.4rem; }
.landing-hero .hero-inner { align-items: center; gap: 3rem; }
.landing-hero .hero-content { max-width: 720px; }
.landing-hero .hero-tag { margin-bottom: 1rem; }
.landing-hero .hero-title {
  font-size: clamp(2.7rem, 4.8vw, 4rem);
  margin-bottom: 0.9rem;
}
.landing-hero .hero-mission { font-size: 1.05rem; max-width: 600px; }
.landing-hero .hero-cta-row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  margin-top: 1.4rem;
}
.hero-specs { flex: 0 0 min(560px, 42vw); }
.hero-specs .spec-item { padding: 0.8rem 1rem; }
.hero-specs .spec-value { font-size: 0.86rem; line-height: 1.35; }
.cta-phone { display: none; }
.cred-seg { display: inline-block; }
/* Wide screens show the spec block; narrower ones show the one-line credential */
@media (min-width: 1000px) { .hero-credential { display: none; } }
@media (max-width: 999px)  { .hero-specs { display: none; } }

/* ── Experience: employer leads, lines stay a readable length ─ */
.about-experience > .section-label { margin-bottom: 0.5rem; }
.about-experience > h2 { font-family: var(--font-sans); }
.exp-role { font-size: 0.95rem; }
.exp-org { font-size: 0.8rem; color: var(--text-body); }
.exp-org strong { color: var(--text-primary); font-weight: 600; }
.exp-points li { margin: 0 0 0.4rem; }
.exp-points li + li { margin-top: 0; }
@media (min-width: 1200px) {
  .exp-points { columns: 2; column-gap: 2.5rem; }
  .exp-points li { break-inside: avoid; }
}

/* ── Closing block: the page ends with a next step ──────────── */
.closing-cta {
  padding: 4rem max(1.5rem, 3vw);
  border-top: 1px solid var(--border-phosphor);
  text-align: center;
}
.closing-cta h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 30ch;
  margin: 0 auto 0.6rem;
}
.closing-sub {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.closing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.4rem;
}
.closing-actions .btn-outline { text-transform: none; }

/* ── Phones (must stay last to win the cascade) ─────────────── */
@media (max-width: 700px) {
  .landing-hero { padding: 5.4rem 1.5rem 0.8rem; }
  .landing-hero .hero-inner { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .landing-hero .hero-title { font-size: 2.75rem; margin-bottom: 0.7rem; }
  .landing-hero .hero-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; width: 100%; }
  .landing-hero .hero-cta-row a { justify-content: center; padding: 0.9rem 0.5rem; }
  .cta-desktop { display: none; }
  .cta-phone { display: inline-flex; }
  .bento-context, .bento-spec { font-size: 0.7rem; }
  /* The readout becomes a bar that floats at the bottom of the skills block
     while a skill is selected; idle, a plain hint sits under the heading. */
  .skill-readout {
    order: 10;
    position: sticky;
    bottom: 0.75rem;
    min-height: 0;
    margin: 0;
    padding: 0.7rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-phosphor-strong);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  }
  .skill-readout:not(.is-active) { display: none; }
  .skill-column-header::after {
    content: 'Tap a skill to see which projects used it.';
    flex-basis: 100%;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.03em;
    color: var(--text-dim);
  }
  .closing-actions a { flex: 1 1 100%; justify-content: center; }
}
