/* ============================================================
   MAIN STYLESHEET  |  portfolio
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:         #f8fafc;
  --bg-alt:     #f1f5f9;
  --surface:    #ffffff;
  --surface-2:  #f1f5f9;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --text-muted: #475569;
  --accent:     #0369a1;
  --accent-2:   #6366f1;
  --success:    #059669;
  --radius:     12px;
  --font:       'Inter', sans-serif;
  --mono:       'Fira Code', monospace;
  --nav-h:      64px;
  --max-w:      1100px;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
img   { max-width: 100%; display: block; }
ul    { list-style: none; }

/* ── BASE ────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  transition: background .3s, color .3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  background: var(--surface-2);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
}
pre {
  background: var(--surface-2);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.section   { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3rem);     font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--text); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; margin-bottom: .75rem; color: var(--text); }
h3 { font-size: 1.1rem;  font-weight: 600; margin-bottom: .4rem; color: var(--text); }
p  { color: var(--text-muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.lead    { font-size: 1.15rem; color: var(--text); margin-bottom: 2rem; }
.eyebrow {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.mt-2 { margin-top: 2rem; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: #fff;
  padding: .55rem 1.2rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem;
  cursor: pointer; border: none;
  font-family: var(--font);
  text-decoration: none;
  transition: opacity .15s, background .15s, color .15s;
}
.btn:hover,
.btn:focus { opacity: .85; text-decoration: none !important; color: #fff; }

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.btn--sm { padding: .35rem .85rem; font-size: .8rem; }

/* ── TAGS ────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tag {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .75rem; font-weight: 500;
  padding: .2rem .6rem; border-radius: 99px;
  border: 1px solid var(--border);
}
.tag--subtle { background: transparent; }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,250,252,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  transition: background .3s;
}
.nav__inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 1.5rem; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__logo   { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.03em; }
.nav__links  { display: flex; align-items: center; gap: 1.5rem; }
.nav__links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color .15s; }
.nav__links a:hover { color: var(--accent); }
.nav__toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

.nav__drawer {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg-alt); padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  z-index: 99; flex-direction: column; gap: .75rem;
}
.nav__drawer a { color: var(--text); font-weight: 500; font-size: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.nav__drawer a:last-child { border-bottom: none; }
.nav__drawer.open { display: flex; }

@media (max-width: 768px) {
  .nav__links  { display: none; }
  .nav__toggle { display: block; }
}

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; }
.theme-toggle__track {
  width: 44px; height: 26px;
  background: #cbd5e1; border-radius: 99px;
  position: relative; display: block; transition: background .3s;
}
.theme-toggle__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* ── HERO ────────────────────────────────────────────────── */
.hero { padding: 5rem 0 4rem; border-bottom: 1px solid var(--border); }
.hero__inner {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 3rem;
}
.hero__headline {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.1;
  color: var(--text); margin-bottom: 1.2rem;
}
.hero__intro { font-size: 1.1rem; color: var(--text-muted); max-width: 540px; margin-bottom: 1.8rem; }
.hero__cta   { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__avatar img {
  width: 200px; height: 200px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

@media (max-width: 640px) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  .hero__avatar { order: -1; display: flex; justify-content: center; }
  .hero__avatar img { width: 140px; height: 140px; }
  .hero__intro { max-width: 100%; }
  .hero__cta { justify-content: center; }
  .weather-widget { justify-content: center; }
}

/* ── STORY ───────────────────────────────────────────────── */
.story-grid { display: grid; gap: 1rem; max-width: 760px; }

/* ── SKILLS ──────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .2s;
}
.skill-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.skill-card h3 {
  color: #4338ca; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6rem;
}

/* ── SECTION HEADER ────────────────────────────────────────── */
.section-header {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.section-header h2 { margin-bottom: 0; }

/* ── HORIZONTAL PHOTO TIMELINE ────────────────────────────── */
.hpt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2.5rem;
  margin-top: .5rem;
}

/* the horizontal line */
.hpt__line {
  position: absolute;
  top: 0;
  left: calc(100% / 6);        /* starts at centre of first card */
  right: calc(100% / 6);       /* ends at centre of last card */
  height: 2px;
  background: var(--border);
}

/* each card is a link */
.hpt__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  gap: 0;
}
.hpt__card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(2,132,199,.12);
  transform: translateY(-4px);
  text-decoration: none;
}

/* dot on the line */
.hpt__dot {
  position: absolute;
  top: -2.15rem;               /* sits on the line */
  left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--border);
}

/* rectangular photo — flush to top of card */
.hpt__avatar {
  width: 100%;
  height: 160px;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
  flex-shrink: 0;
}
.hpt__avatar img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.hpt__card:hover .hpt__avatar { border-color: var(--accent); }

.hpt__date {
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 1rem;
}
.hpt__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  padding: .25rem 1rem 0;
}
.hpt__caption {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding: .2rem 1rem 0;
}

@media (max-width: 600px) {
  .hpt { grid-template-columns: 1fr; padding-top: 0; }
  .hpt__line { display: none; }
  .hpt__dot  { display: none; }
}

/* ── AI CALLOUT ──────────────────────────────────────────── */
.ai-callout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.ai-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s;
}
.ai-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(2,132,199,.1); }
.ai-card__icon { font-size: 1.8rem; margin-bottom: .75rem; }
.ai-card h3 { color: var(--text); }

/* ── CERTIFICATIONS ──────────────────────────────────────── */
.cert-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.cert-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex; flex-direction: column; gap: .25rem;
  min-width: 220px; flex: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cert-badge__code   { font-family: var(--mono); font-size: .8rem; font-weight: 600; }
.cert-badge__name   { font-weight: 600; color: var(--text); font-size: .95rem; }
.cert-badge__issuer { font-size: .8rem; color: var(--text-muted); }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline {
  position: relative; padding-left: 1.75rem;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 2rem;
  margin-top: 2rem;
}
.timeline__item    { position: relative; }
.timeline__marker  {
  position: absolute; left: -2.4rem; top: .4rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  flex-shrink: 0;
}
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.timeline__header  {
  display: flex; align-items: flex-start; gap: .75rem;
  margin-bottom: .75rem; flex-wrap: wrap;
}
.timeline__role    { font-size: 1.05rem; color: var(--text); line-height: 1.3; }
.timeline__company {
  font-size: .85rem; color: var(--text-muted); margin: .2rem 0 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
}
.timeline__period  { color: var(--accent-2); white-space: nowrap; }
.timeline__summary { margin-bottom: .75rem; font-size: .9rem; }
.timeline__clients { margin-bottom: .5rem; font-size: .85rem; }

.company-logo      { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.company-logo-text {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .7rem; color: #fff; flex-shrink: 0;
}

@media (max-width: 600px) {
  .timeline {
    padding-left: 1.25rem;
    border-left-width: 2px;
  }
  .timeline__marker {
    left: -1.85rem;
    width: 11px; height: 11px;
  }
  .timeline__card { padding: 1rem; }
  .timeline__header { gap: .6rem; }
  .timeline__role { font-size: 1rem; }
  .timeline__company { font-size: .8rem; flex-direction: column; gap: .1rem; }
  .timeline__company .timeline__period { margin-left: 0; }
  .tag-list { gap: .3rem; }
  .tag { font-size: .7rem; padding: .15rem .5rem; }
}

/* ── PROJECTS ────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem; margin-top: 2rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.project-card h2 { font-size: 1.2rem; margin-bottom: .25rem; }
.project-card__type {
  font-size: .78rem; color: var(--accent-2);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .5rem;
}
.project-card__highlight { color: var(--success); font-weight: 500; font-size: .9rem; margin-top: .5rem; }

/* ── MEDIA ───────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem; margin-top: 2rem;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
/* ── LINKEDIN CARD ───────────────────────────────────────── */
.li-card {
  display: block;
  margin-top: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.li-card:hover {
  border-color: #0a66c2;
  box-shadow: 0 4px 16px rgba(10,102,194,.12);
  text-decoration: none;
}
.li-card__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem .75rem;
}
.li-card__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.li-card__name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.li-card__meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}
.li-card__body {
  font-size: .88rem;
  color: var(--text);
  padding: 0 1rem .75rem;
  line-height: 1.6;
  margin: 0;
}
.li-card__img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.li-card__img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.li-card__footer {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
}
.li-card__cta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: #0a66c2;
}

.media-card__type  { font-size: .7rem; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.media-card__label { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }

/* ── REFERENCES ──────────────────────────────────────────── */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem; margin-top: 2rem;
}
.ref-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s;
}
.ref-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.ref-card__header  { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.ref-card__avatar  {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0;
}
.ref-card__name    { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .1rem; }
.ref-card__title   { font-size: .82rem; color: var(--text-muted); margin: 0 0 .4rem; }
.ref-card__context { font-size: .88rem; color: var(--text-muted); margin-bottom: .75rem; }
.ref-card__link    { font-size: .82rem; font-weight: 600; color: var(--accent); }
.ref-card__link:hover { text-decoration: underline; }

/* ── BLOG POST LIST ──────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 2rem; }
.post-card {
  display: flex; flex-direction: row;
  align-items: flex-start; gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none; color: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.post-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.post-card__img {
  width: 140px; height: 100px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
}
.post-card__body { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.post-card__body h2 { font-size: 1rem; font-weight: 600; margin: 0; color: var(--text); }
.post-card:hover .post-card__body h2 { color: var(--accent); }
.post-card__body p  { font-size: .88rem; color: var(--text-muted); margin: 0; }
.post-card__date    { font-size: .78rem; color: var(--text-muted); }
.post-card:not(:has(.post-card__img)) .post-card__body { width: 100%; }

/* ── PROSE ───────────────────────────────────────────────── */
.prose h1, .prose h2, .prose h3 { color: var(--text); margin-top: 2rem; }
.prose p                         { color: var(--text-muted); }
.prose ul, .prose ol             { padding-left: 1.5rem; color: var(--text-muted); }
.prose li                        { margin-bottom: .4rem; }
.prose a                         { color: var(--accent); }
.prose table {
  width: 100%; border-collapse: collapse;
  margin: 1.5rem 0; font-size: .88rem;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.prose table thead { background: var(--bg-alt); }
.prose table th {
  padding: .65rem 1rem; text-align: left;
  font-weight: 600; color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
}
.prose table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); vertical-align: top;
}
.prose table tr:last-child td { border-bottom: none; }
.prose table tr:hover td { background: var(--bg-alt); }
@media (max-width: 640px) {
  .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.post-hero-img {
  width: 100%; max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

/* ── PHOTO WALL (Gallery) ────────────────────────────────── */
.photo-wall {
  min-height: 100vh;
  padding: 4rem 3rem 6rem;
  position: relative;

  /* Deep corkboard — layered for richness */
  background-color: #2a1f14;
  background-image:
    /* fine noise grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
    /* cork fibre streaks */
    repeating-linear-gradient(
      17deg,
      transparent,
      transparent 2px,
      rgba(255,220,150,.018) 2px,
      rgba(255,220,150,.018) 3px
    ),
    repeating-linear-gradient(
      -11deg,
      transparent,
      transparent 3px,
      rgba(200,160,90,.015) 3px,
      rgba(200,160,90,.015) 4px
    ),
    /* warm radial depth — light from top-centre */
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      rgba(180,120,50,.18) 0%,
      transparent 70%
    ),
    /* deep vignette edges */
    radial-gradient(
      ellipse 100% 100% at 50% 50%,
      rgba(60,35,10,.0) 40%,
      rgba(10,5,0,.65) 100%
    );
  box-shadow:
    inset 0 0 120px rgba(0,0,0,.6),
    inset 0 0 40px rgba(0,0,0,.4);
}

/* subtle top border glow */
.photo-wall::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,200,100,.06) 0%,
    transparent 12%
  );
  pointer-events: none;
}

.photo-wall__heading {
  position: relative;
  text-align: center;
  font-size: 2rem; font-weight: 700;
  color: rgba(255,220,160,.55);
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-bottom: 3.5rem;
  font-family: 'Permanent Marker', cursive;
  text-shadow:
    0 0 40px rgba(255,180,80,.25),
    0 2px 8px rgba(0,0,0,.8);
}

/* CSS columns = natural vertical scatter, no JS */
.photo-wall__grid {
  columns: 4 180px;
  column-gap: 2rem;
}

/* ── Instax card — real postcard proportions ── */
.instax {
  position: relative;
  background: #fdf8f0;
  border-radius: 3px;
  padding: .6rem .6rem 1.1rem;
  width: 180px;
  display: inline-block;
  margin-bottom: 2.5rem;
  box-shadow:
    0 2px 4px rgba(0,0,0,.4),
    0 8px 20px rgba(0,0,0,.5),
    0 20px 60px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.8);
  break-inside: avoid;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.instax:hover {
  box-shadow:
    0 4px 8px rgba(0,0,0,.5),
    0 16px 40px rgba(0,0,0,.6),
    0 32px 80px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.8);
}

/* Rotation + vertical stagger per item */
.instax:nth-child(8n+1) { transform: rotate(-3deg);   margin-top: 0px;  }
.instax:nth-child(8n+2) { transform: rotate(2.5deg);  margin-top: 40px; }
.instax:nth-child(8n+3) { transform: rotate(-1.5deg); margin-top: 20px; }
.instax:nth-child(8n+4) { transform: rotate(3.5deg);  margin-top: 55px; }
.instax:nth-child(8n+5) { transform: rotate(-2deg);   margin-top: 10px; }
.instax:nth-child(8n+6) { transform: rotate(1deg);    margin-top: 45px; }
.instax:nth-child(8n+7) { transform: rotate(-4deg);   margin-top: 25px; }
.instax:nth-child(8n+8) { transform: rotate(2deg);    margin-top: 60px; }

/* ── Magnetic pin — now slightly different colors per item ── */
.instax__pin {
  position: absolute; top: -13px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e53e3e 40%, #9b1c1c 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,.7), 0 1px 3px rgba(0,0,0,.5), inset 0 1px 2px rgba(255,255,255,.6);
  z-index: 5;
}
/* Alternate pin colors for variety */
.instax:nth-child(3n+1) .instax__pin {
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e53e3e 40%, #9b1c1c 100%);
}
.instax:nth-child(3n+2) .instax__pin {
  background: radial-gradient(circle at 35% 30%, #fff 0%, #3b82f6 40%, #1d4ed8 100%);
}
.instax:nth-child(3n+3) .instax__pin {
  background: radial-gradient(circle at 35% 30%, #fff 0%, #10b981 40%, #065f46 100%);
}

/* ── Photo frame ── */
.instax__frame {
  width: 100%;
  height: 160px;          /* taller, real postcard photo area */
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: .5rem;
}
.instax__photo {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: opacity .3s;
}

/* ── Label ── */
.instax__label { text-align: center; padding: 0 .2rem; }
.instax__date {
  display: block;
  font-size: .72rem; color: #aaa;           /* slightly bigger */
  letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: .25rem;
  font-family: 'Caveat', cursive;            /* handwritten date */
  font-weight: 600;
}
.instax__caption {
  font-size: 1rem;
  color: #222; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: 'Permanent Marker', cursive;
  letter-spacing: .02em;
  line-height: 1.3;
  cursor: help;
}

/* ── Global floating tooltip ── */
.gallery-tooltip {
  position: fixed;
  background: #111;
  color: #fff;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  font-weight: 600;
  padding: .4rem .85rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s ease;
}
.gallery-tooltip.visible { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .photo-wall__grid { columns: 3 160px; }
}
@media (max-width: 600px) {
  .photo-wall__grid { columns: 2 140px; }
  .instax { width: 140px; }
  .instax__frame { height: 130px; }
}
@media (max-width: 380px) {
  .photo-wall__grid { columns: 1; }
  .instax { width: 170px; }
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
  animation: lb-fade-in .2s ease;
}
@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox__card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 1rem 1rem 2rem;
  max-width: 540px;
  width: 100%;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.1),
    0 50px 120px rgba(0,0,0,.7),
    0 8px 32px rgba(0,0,0,.3);
  cursor: default;
  animation: lb-pop-in .32s cubic-bezier(.34,1.4,.64,1);
}
@keyframes lb-pop-in {
  from { transform: scale(.86) translateY(20px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.lightbox__close {
  position: absolute;
  top: .9rem; right: .9rem;
  width: 34px; height: 34px;
  background: rgba(0,0,0,.08);
  border: none; border-radius: 50%;
  font-size: 1.1rem; line-height: 1;
  color: #666; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  z-index: 2;
}
.lightbox__close:hover { background: rgba(0,0,0,.15); color: #111; }

.lightbox__img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.lightbox__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.lightbox__info { padding: 0 .75rem; text-align: center; }

.lightbox__date {
  display: block;
  font-size: .7rem; color: #bbb;
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .6rem;
  font-family: 'Caveat', cursive; font-weight: 600;
}
.lightbox__title {
  font-size: 1.5rem; font-weight: 700;
  color: #111; margin-bottom: .5rem;
  font-family: 'Permanent Marker', cursive;
  line-height: 1.2;
}
.lightbox__caption {
  font-family: 'Caveat', cursive;
  font-weight: 600; font-size: 1.15rem;
  color: #555; line-height: 1.5; margin: 0;
}

@media (max-width: 520px) {
  .lightbox__card { padding: .75rem .75rem 1.5rem; border-radius: 14px; }
  .lightbox__title { font-size: 1.2rem; }
}
/* ── MEDIA ───────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.media-card__type {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; color: var(--accent);
  margin-bottom: .25rem;
}
.media-card__label {
  font-size: 1.1rem; font-weight: 600;
  color: var(--text); margin-bottom: .35rem;
}
.media-card__desc {
  font-size: .88rem; color: var(--text-muted);
  margin-bottom: .75rem;
}

/* ── Instagram embed container — clips the iframe overflow ── */
.media-card__embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;           /* clips instagram iframe */
  border-radius: 8px;
  margin-top: .5rem;
}

/* Force the blockquote + injected iframe to never exceed card width */
.media-card__embed .instagram-media,
.media-card__embed iframe {
  max-width: 100% !important;
  min-width: unset !important;
  width: 100% !important;
  margin: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  border: none !important;
}

/* Both card types — same fixed height */
.media-card--instagram .media-card__embed,
.media-card--reel .media-card__embed {
  aspect-ratio: 4 / 5;
  overflow-y: auto;
}

.media-card--instagram .media-card__embed iframe,
.media-card--reel .media-card__embed iframe {
  height: 100% !important;
  min-height: 100% !important;
}

@media (max-width: 768px) {
  .media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .post-card { flex-direction: column; }
  .post-card__img { width: 100%; height: 180px; }
  .ref-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .cert-badge { min-width: unset; }
  .section { padding: 2.5rem 0; }
}

/* ── FOOTER ─────────────────────────────────────────────── */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); text-align: center; }
.footer p { font-size: .88rem; color: var(--text-muted); }
.footer a { color: var(--accent); font-weight: 500; }
.footer a:hover { text-decoration: underline; }
.footer__copy { margin-top: .25rem; font-size: .8rem; }
.weather-widget {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .35rem .9rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.weather-widget[hidden] { display: none; }
.weather-widget__sep { opacity: .4; }


/* ── Resume Gate ──────────────────────────────────────────────────────────── */

.resume-gate { max-width: 640px; }

.resume-gate__sub {
  color: var(--text-muted);
  font-size: .95rem;
  margin-top: -.5rem;
  margin-bottom: 2rem;
}

.resume-gate__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.resume-gate__note {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.resume-gate__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group .optional { font-weight: 400; color: var(--text-muted); }

.form-group input {
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3,105,161,.12);
}

.resume-gate__error {
  font-size: .85rem;
  color: #dc2626;
  margin-bottom: .75rem;
}

.resume-gate__download { text-align: center; padding: 2rem 0; }

.resume-gate__success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: .95rem;
}

.resume-gate__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.resume-gate__hint {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--text-muted);
}

.resume-gate__hint a { color: var(--accent); }

/* Honeypot — visually hidden, not accessible to real users */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Table of Contents ───────────────────────────────────────────────────── */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: inline-block;
  min-width: 260px;
  max-width: 100%;
}

.toc__title {
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin: .3rem 0; font-size: .9rem; }
.toc ol ol { margin-top: .2rem; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
