/* ===========================================================
   V6 - assembled from the strongest pieces of V5.1 / V5.2 / V5.3
   Hero: V5.1 (framed bento window). Work: V5.1 content, re-laid
   out to strict 2-per-row pairs. Craft: new panel (V3's lead +
   definition-list idea, in V6's tile language). Career: V5.2
   (current-role callout + list). Contact: V5.3 (simple centered).
   =========================================================== */

:root {
  --bg: #f0f0f2;
  --card: #ffffff;
  --frame: #f7f7f8;
  --ink: #131315;
  --ink-secondary: #6d6d73;
  --hairline: #e2e2e5;
  --accent: #ff5d3a;
  --media-fill: #e7e7ea;
  --radius: 20px;
  --radius-lg: 28px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 1440px; margin-inline: auto; padding-inline: 1.5rem; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 800; line-height: 1.1; }
em { font-style: normal; color: var(--accent); }

/* ---------- Tile base ---------- */
.tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
}
.tile.tile--in { opacity: 1; transform: none; transition: opacity 0.55s cubic-bezier(0.16,1,0.3,1), transform 0.55s cubic-bezier(0.16,1,0.3,1); }
a.tile { text-decoration: none; color: inherit; display: block; transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease; }
a.tile:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -24px rgb(19 19 21 / 0.18); }

/* ---------- Hero: single framed window (V5.1) ---------- */
.hero-frame-wrap { display: flex; align-items: center; min-height: 100svh; padding-block: 1.5rem; }

.hero-frame {
  width: 100%;
  height: min(900px, calc(100svh - 3rem));
  background: var(--frame);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 1.25rem;
}

.tile--identity { display: flex; flex-direction: column; justify-content: center; padding: 2.75rem; }
.greeting { margin: 0 0 0.75rem; color: var(--ink-secondary); font-size: 2rem; font-weight: 300; }
.tile--identity h1 { font-size: clamp(1.5rem, 2.5vw, 2.25rem); max-width: 20ch; }
.status { display: flex; align-items: center; gap: 0.6rem; margin: 1.5rem 0 0; font-size: 0.9375rem; color: var(--ink-secondary); }
.status-line { display: contents; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf5f; flex-shrink: 0; animation: dot-pulse 2.4s ease-in-out infinite; }
.status-sep { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25em; line-height: 1; position: relative; top: -0.05em; }
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.shimmer-text {
  background: linear-gradient(90deg, var(--ink-secondary) 0%, var(--ink-secondary) 25%, #fff 50%, var(--ink-secondary) 75%, var(--ink-secondary) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: text-shimmer 3.4s ease-in-out infinite;
}
@keyframes text-shimmer {
  0% { background-position: 160% 0; }
  41% { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}

.tile-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; padding: 0.8rem 1.4rem; border-radius: 999px; font-size: 0.875rem; font-weight: 800; text-decoration: none; transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); color: var(--accent); }
.btn-ghost { border: 1px solid var(--hairline); }
.btn-ghost:hover { transform: translateY(-2px); color: var(--accent); }
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid var(--hairline); font-size: 0.8125rem; font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.icon-link:hover { transform: translateY(-2px); color: var(--accent); }

.hero-side { display: flex; flex-direction: column; min-height: 0; gap: 1.25rem; }
.tile--portrait { flex: 1; min-height: 0; min-width: 0; padding: 0; overflow: hidden; }
.tile--portrait .media-fill { width: 100%; height: 100%; background: var(--media-fill); object-fit: cover; object-position: center top; display: block; }

.tile--nav-card { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0.4rem; position: relative; }
.tile--nav-card span:first-child { font-size: 1.125rem; font-weight: 800; }
.tile--nav-card p { margin: 0; font-size: 0.875rem; color: var(--ink-secondary); max-width: 22ch; }
.tile--nav-card .arrow { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 1.125rem; color: var(--ink-secondary); transition: transform 0.25s ease, color 0.25s ease; }
.tile--nav-card:hover .arrow { transform: translate(2px, -2px); color: var(--accent); }

.hero-side--right { justify-content: space-between; }

.tile--partners {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 1.25rem 2.5rem;
}
.partners-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; min-width: 0; }
.partner-logo { display: flex; align-items: center; color: var(--ink-secondary); transition: color 0.25s ease; }
.partner-logo:hover { color: var(--ink); }
.partner-logo svg { height: 15px; width: auto; display: block; }
.partner-logo[aria-label="Google"] svg { height: 19.8px; }
.partner-logo[aria-label="Wave"] svg { height: 12.75px; }
.partner-logo[aria-label="Workflow Builder"] svg { height: 13.95px; }
.partner-logo[aria-label="UBS"] svg { height: 25.74px; }
.partner-logo[aria-label="Autopay"] svg { height: 16.5px; }

@media (max-width: 900px) {
  .hero-frame-wrap { min-height: auto; padding-top: 2rem; }
  .hero-frame { height: auto; grid-template-columns: 1fr; grid-template-rows: auto; }
  .hero-side, .hero-side--right { flex-direction: row; }
  .tile--identity { padding: 2rem; }
  .tile--partners { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .partners-row { flex-wrap: wrap; justify-content: flex-start; gap: 1.5rem 2rem; width: 100%; }
}
@media (max-width: 560px) {
  .hero-side, .hero-side--right { flex-direction: column; }
}

/* ---------- Section head ---------- */
.section-head { max-width: 56ch; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.section-head p { margin: 0.9rem 0 0; color: var(--ink-secondary); font-size: 1.0625rem; }
.work, .craft, .proof, .career, .contact { padding-block: 5.5rem; }
.career > h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: 2.5rem; }
.career-more-row { display: flex; justify-content: flex-end; }
.career-more-link { margin-top: 1.75rem; }

/* ---------- Work: 3-per-row ---------- */
.mosaic--work-pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tile--work { padding: 0; overflow: hidden; }
.tile--work .media-fill { width: 100%; aspect-ratio: 1600/1200; background: var(--media-fill); object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(0.16,1,0.3,1); }
a.tile--work:hover .media-fill { transform: scale(1.045); }
.work-copy { padding: 1.4rem 1.6rem 1.75rem; }
.work-meta { display: flex; align-items: center; gap: 0.625rem; }
.work-avatar { width: 24px; height: 24px; border-radius: 50%; background: #131315; flex-shrink: 0; }
.work-copy h3 { font-size: 1rem; }
.work-copy p { margin: 0.45rem 0 0.7rem; color: var(--ink-secondary); font-size: 0.9375rem; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.tech-tag { display: inline-flex; align-items: center; padding: 0.3rem 0.7rem; border-radius: 999px; background: none; border: 1px solid var(--hairline); color: var(--ink-secondary); font-size: 0.75rem; font-weight: 800; }

@media (max-width: 900px) { .mosaic--work-pairs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .mosaic--work-pairs { grid-template-columns: 1fr; } }

/* ---------- Craft: two tiles, mirroring the Career mosaic but reversed
   (wide tile first, narrow tile second) ---------- */
.mosaic--craft { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; align-items: stretch; }
.tile--craft-defs { padding: 3rem; }
.tile--craft-lead { padding: 3rem 5.5rem 3rem 3rem; display: flex; flex-direction: column; justify-content: center; }
.craft-headline { margin: 0; font-size: 2.5rem; line-height: 1.1; font-weight: 300; letter-spacing: -0.015em; color: var(--ink); max-width: 22ch; }

.craft-defs { margin: 0; }
.craft-def { padding-block: 1.4rem; border-top: 1px solid var(--hairline); }
.craft-def:first-child { border-top: none; padding-top: 0; }
.craft-def dt { font-weight: 800; font-size: 1.0625rem; margin-bottom: 0.4rem; transition: color 0.25s ease; }
.craft-def:hover dt { color: var(--accent); }
.craft-def dd { margin: 0; color: var(--ink-secondary); font-size: 0.9375rem; max-width: 48ch; }

@media (max-width: 780px) {
  .mosaic--craft { grid-template-columns: 1fr; gap: 1.25rem; }
  .tile--craft-defs, .tile--craft-lead { padding: 2rem; }
}

/* ---------- Proof: framed bento, matching the hero frame ---------- */
.proof-frame { background: var(--frame); border-radius: var(--radius-lg); padding: 1.25rem; }
.mosaic--proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tile--quote { display: flex; flex-direction: column; justify-content: flex-start; margin: 0; }
.tile--quote .quote-mark { font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--accent); margin-bottom: 0.375rem; }
.tile--quote p { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.45; }
.tile--quote cite { display: flex; align-items: center; gap: 0.75rem; font-style: normal; }
.quote-avatar { flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; }
.quote-who { display: flex; flex-direction: column; }
.quote-name { font-weight: 800; font-size: 0.875rem; }
.quote-role { font-size: 0.8125rem; color: var(--ink-secondary); }

.tile--quote-featured { grid-column: 1 / 3; background: #212121; color: #fff; padding: 2.75rem; }
.tile--quote-featured p { max-width: 62ch; font-size: 1.375rem; line-height: 1.45; font-weight: 400; }
.tile--quote-featured .quote-avatar { background: var(--accent); }
.tile--quote-featured .quote-role { color: rgb(255 255 255 / 0.6); }

@media (max-width: 900px) {
  .mosaic--proof-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .mosaic--proof-grid { grid-template-columns: 1fr; }
  .tile--quote-featured { padding: 2rem; }
  .tile--quote-featured p { font-size: 1.1875rem; }
}

/* ---------- Career: current-role callout + list (V5.2) ---------- */
.mosaic--career { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.25rem; align-items: stretch; }
.tile--now { padding: 0; overflow: hidden; min-height: 320px; min-width: 0; }
.tile--now .media-fill { width: 100%; height: 100%; min-height: 0; background: var(--media-fill); object-fit: cover; object-position: center 25%; display: block; }
.tile--career-list { padding: 0.5rem 1.75rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 160px 1fr auto; gap: 0 1.25rem; padding-block: 2rem; padding-right: 16px; border-top: 1px solid var(--hairline); align-items: center; }
.timeline li:first-child { border-top: none; }
.org-logo { grid-row: 1/3; grid-column: 1; width: 160px; height: 100%; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--hairline); flex-shrink: 0; }
.org-logo img { display: block; width: auto; max-width: 100%; }
.role { grid-column: 2; font-weight: 800; font-size: 1rem; line-height: 1.1; }
.org { grid-column: 2; color: var(--ink-secondary); font-size: 0.875rem; line-height: 1.1; margin-top: 4px; }
.when { grid-row: 1/3; grid-column: 3; align-self: center; color: var(--accent); font-weight: 800; font-size: 1rem; white-space: nowrap; }

@media (max-width: 480px) {
  .timeline li { grid-template-columns: 96px 1fr auto; gap: 0 0.85rem; }
  .org-logo { width: 96px; }
}

@media (max-width: 780px) { .mosaic--career { grid-template-columns: 1fr; } .tile--now { min-height: 260px; } }

/* ---------- Contact: framed bento (main CTA + status card), echoing the hero frame ---------- */
.contact-frame { background: var(--frame); border-radius: var(--radius-lg); padding: 1.25rem; display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: stretch; }

.tile--contact-main { padding: 3.5rem; background: #212121; color: #fff; }
.tile--contact-main h2 { font-size: clamp(2rem, 4vw, 2.875rem); line-height: 1.1; max-width: 20ch; }
.tile--contact-main p { margin: 1rem 0 2.25rem; color: rgb(255 255 255 / 0.65); font-size: 1.0625rem; max-width: 40ch; }
.contact-email { display: inline-block; font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 800; text-decoration: none; color: #fff; transition: color 0.2s ease; }
.contact-email:hover { color: var(--accent); }

.tile--contact-status { display: flex; flex-direction: column; justify-content: center; gap: 0.5rem; position: relative; padding: 2.5rem; }
.tile--contact-status .status { margin: 0; font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.tile--contact-status .contact-status-desc { margin: 0; font-size: 0.875rem; color: var(--ink-secondary); }
.tile--contact-status .arrow { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 1.125rem; color: var(--ink-secondary); transition: transform 0.25s ease, color 0.25s ease; }
.tile--contact-status:hover .arrow { transform: translate(2px, -2px); color: var(--accent); }

@media (max-width: 780px) {
  .contact-frame { grid-template-columns: 1fr; }
  .tile--contact-main { padding: 2.5rem; }
  .tile--contact-status { padding: 2rem; }
}

/* ---------- Footer ---------- */
.site-footer { display: flex; justify-content: space-between; padding-block: 2rem; border-top: 1px solid var(--hairline); color: var(--ink-secondary); font-size: 0.8125rem; }
@media (max-width: 640px) {
  .site-footer { flex-direction: column; align-items: center; text-align: center; gap: 0.75rem; }
}

/* ===========================================================
   Phone-only fixes (real-device pass). Every rule below is
   scoped to max-width:640px so tablet and desktop stay exactly
   as they were.
   =========================================================== */
@media (max-width: 640px) {
  /* Hero status line: "Currently at Zendesk" and "open to new
     roles" were sharing one flex row with no wrap, so each half
     shrank and wrapped its own text into a ragged two-column
     mess. Stack them as two clean lines instead; the separator
     dot only makes sense inline, so it's dropped when stacked. */
  .status { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .status-line { display: flex; align-items: center; gap: 0.6rem; }
  .status-sep { display: none; }

  /* LinkedIn icon sizing/placement is now handled by the base
     .icon-link rule (matches on every breakpoint), so nothing
     phone-specific is needed here any more. */

  /* Partner logos: the 900px breakpoint already wraps them into
     a left-aligned block; center each wrapped row instead. */
  .partners-row { justify-content: center; }

  /* Hero -> "My recent work" gets a snug ~112px gap (hero's own
     reduced bottom padding + the section's top padding). "My
     recent work" -> "What I deliver" was getting a full 176px
     (two full 5.5rem section paddings back to back) since both
     are ordinary sections. Trim craft's top padding to match. */
  .craft { padding-top: 1.5rem; }

  /* Career timeline::160px logo column + auto date column left
     almost nothing for the role/company text, which wrapped
     five lines deep. Stack every row instead: logo, then role
     + company, then the date, each full width. */
  .timeline li {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.35rem 0;
    padding-block: 1.5rem;
  }
  .org-logo {
    grid-row: 1;
    grid-column: 1;
    width: auto;
    height: auto;
    justify-content: flex-start;
    border-right: none;
    margin-bottom: 0.85rem;
  }
  .role { grid-row: 2; grid-column: 1; }
  .org { display: none; }
  .when {
    grid-row: 3;
    grid-column: 1;
    align-self: start;
    margin-top: 0.25rem;
  }

  /* "More about me": right-aligned reads as off-balance on a
     narrow single-column layout; center it under the timeline. */
  .career-more-row { justify-content: center; }

  /* Testimonials grid: the featured quote's grid-column:1/3
     asks for a 3rd column line that doesn't exist once the grid
     collapses to a single 1fr track, so the browser silently
     adds an implicit second column to satisfy it -- which is
     what was actually causing the 2-up layout here, not the
     column count itself. Drop the span, then send "Need more
     opinions" to the end of the stack. */
  .tile--quote-featured { grid-column: 1; }
  .mosaic--proof-grid .tile--nav-card { order: 99; }
}
