/* ============================================================
   PINAK TILAVAT — PORTFOLIO STYLESHEET

   Index
   1. Design tokens
   2. Base / reset
   3. Navigation
   4. Hero (scroll-driven)
   5. Section shell
   6. About
   7. Experience / Capabilities
   8. Projects (panel + macOS dock)
   9. Contact
   10. Footer
   11. Responsive
   ============================================================ */

/* ── 1. Design tokens ─────────────────────────────────────── */
:root {
  --bg: #FFFFFF;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --accent: #48484a;
  --red: #ff3b30;
  --line: #e2e2e7;
  --line-soft: #ececf0;
  --panel: #f5f5f7;
  --panel-deep: #e8e8ed;
  --serif: 'Newsreader', serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
}

/* ── 2. Base / reset ──────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: #e2e2e7; }

a { color: inherit; }

img, video { display: block; }

/* ── 4. Hero (scroll-driven) ──────────────────────────────── */
/* #top is a tall scroll track; .hero-sticky pins the hero while
   [data-reveal] elements fade in as the visitor scrolls. */
#top {
  height: 560vh;
  position: relative;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
}

.hero-grid {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
  text-align: right;
}

.hero-hi,
.hero-name {
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 300;
  line-height: 1.13;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.hero-tagline {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
}

.hero-role {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 13px;
  font-weight: 400;
}

.hero-role .old {
  position: relative;
  color: var(--faint);
}

.hero-role .strike {
  position: absolute;
  left: 0;
  top: 58%;
  height: 1px;
  background: var(--accent);
  width: 0;
  transform-origin: left;
}

.hero-role .arrow { color: var(--accent); }

.hero-role .new {
  color: var(--red);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

/* M3 Expressive: full pills that morph squarer + shrink on press. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: transform .2s ease, background .2s ease, border-radius .25s ease;
}

.btn:active {
  border-radius: 14px;
  transform: scale(.96);
}

.btn-solid {
  background: var(--ink);
  color: #fff;
}

.btn-solid:hover { background: #333336; }

.btn-ghost {
  background: var(--panel);
  color: var(--ink);
  border: none;
}

.btn-ghost:hover { background: var(--panel-deep); }

.hero-social {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  transition: color .2s ease;
}

.hero-social a:hover { color: var(--accent); }

.hero-photo { position: relative; }

.hero-photo .frame {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  aspect-ratio: 0.82;
  border-radius: 20px;
  overflow: hidden;
  background: var(--panel);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

[data-reveal] { will-change: opacity, transform; }

/* ── 5. Section shell ─────────────────────────────────────── */
section { padding: clamp(90px, 12vw, 160px) 5vw; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.eyebrow .bar {
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.eyebrow .bar.grey { background: var(--faint); }

.eyebrow .label {
  font-size: 12px;
  letter-spacing: 0.24em;
  font-weight: 500;
  color: var(--faint);
}

/* ── 6. About ─────────────────────────────────────────────── */
#about {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 56px;
  align-items: center;
}

.about-map-wrap {
  position: relative;
  padding-top: 52px;
}

.about-note {
  position: absolute;
  top: -4px;
  left: -14px;
  pointer-events: none;
  font-family: 'Caveat', cursive;
  font-size: 23px;
  font-weight: 600;
  color: var(--red);
  transform: rotate(-11deg);
  line-height: 1.05;
  white-space: nowrap;
}

.about-map {
  width: 320px;
  height: 230px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  position: relative;
}

.about-map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-h {
  font-family: var(--serif);
  font-size: clamp(27px, 4.2vw, 40px);
  font-weight: 300;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.about-h .accent { color: var(--red); }

.about-sub {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 52px;
}

.stat {
  background: var(--bg);
  padding: 16px 30px;
}

.stat .n {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  color: var(--red);
  letter-spacing: -0.01em;
}

.stat .l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}

/* ── 7. Experience / Capabilities ─────────────────────────── */
.folder-tabs {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.folder-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 16px 26px 14px;
  cursor: pointer;
  transition: background .22s ease;
}

.folder-tab:hover { background: var(--panel); }

.folder-tab.active { background: rgba(0, 0, 0, 0.06); }

.folder-tab.active:hover { background: rgba(0, 0, 0, 0.09); }

.folder-tab .flabel {
  font-size: 14px;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0.01em;
  transition: color .22s ease;
}

.folder-tab.active .flabel {
  font-weight: 500;
  color: var(--ink);
}

.exp-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 56px;
  margin-top: 48px;
  align-items: start;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.exp-row {
  border-radius: 14px;
  padding: 18px 22px;
  cursor: pointer;
  transition: background .28s ease;
  background: transparent;
}

.exp-row .rdate {
  font-size: 12px;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--faint);
  transition: color .28s ease;
}

.exp-row .rtitle {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 5px;
  transition: color .28s ease;
}

.exp-row:hover { background: var(--panel); }
.exp-row:hover .rdate { color: var(--muted); }
.exp-row:hover .rtitle { color: var(--ink); }

.exp-row.selected { background: var(--ink); }
.exp-row.selected .rdate { color: rgba(255, 255, 255, 0.65); }
.exp-row.selected .rtitle { color: var(--bg); }
.exp-row.selected:hover { background: #333336; }

/* Golden glow — draws the eye to a couple of standout entries. */
.exp-row.glow {
  box-shadow: 0 0 0 1px rgba(212, 160, 61, 0.35), 0 0 18px rgba(212, 160, 61, 0.35);
  animation: rowGlow 2.6s ease-in-out infinite;
}
.exp-row.glow .rdate { color: #b9812f; }
.exp-row.glow:hover { background: rgba(212, 160, 61, 0.08); }
.exp-row.glow.selected {
  background: linear-gradient(135deg, #4a3c1e, var(--ink) 60%);
  box-shadow: 0 0 0 1px rgba(212, 160, 61, 0.55), 0 0 22px rgba(212, 160, 61, 0.5);
}
.exp-row.glow.selected .rdate { color: #e8b756; }

@keyframes rowGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(212, 160, 61, 0.3), 0 0 14px rgba(212, 160, 61, 0.28); }
  50%      { box-shadow: 0 0 0 1px rgba(212, 160, 61, 0.55), 0 0 24px rgba(212, 160, 61, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .exp-row.glow { animation: none; }
}

.exp-detail-hold {
  position: sticky;
  top: 80px;
  min-width: 0;
}

.exp-panel {
  background: var(--panel);
  border-radius: 22px;
  padding: 34px;
  min-height: 420px;
}

.exp-panel.empty {
  background: transparent;
  min-height: 0;
  padding: 0;
}

.d-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.d-badge {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
}

.d-badge.accent { background: var(--accent); }

.d-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.d-date {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.d-title {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 400;
  margin: 16px 0 0;
  color: var(--ink);
}

.d-org {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.d-body {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 520px;
}

.d-bullet {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  max-width: 520px;
}

.d-bullet .b {
  position: absolute;
  left: 0;
  color: var(--accent);
}

.d-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.d-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
  transition: background .2s ease, border-radius .25s ease, transform .2s ease;
}

.d-btn:hover { background: var(--panel-deep); }

.d-btn:active {
  border-radius: 12px;
  transform: scale(.96);
}

/* Gallery — one tidy row: every photo shares the same height and
   keeps its original aspect ratio; tap an image to open it. */
.d-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 22px;
}

.d-gallery img,
.d-gallery video {
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  background: var(--panel-deep);
}

.d-gallery img { height: 140px; }

/* Videos get more presence than photos. */
.d-gallery video { height: 240px; }

/* Split layout — video on one side, photos grouped on the other.
   Video height matches two photo rows (140 × 2 + 8 gap). */
.d-gallery.split video { height: 288px; }

.d-gal-imgs {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.d-gallery img { cursor: zoom-in; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

/* ── 8. Projects (panel + macOS dock) ─────────────────────── */
/* Desktop — empty stage where app windows open, macOS style.
   Height follows the tallest open window (set from JS). */
.apps-desktop {
  position: relative;
  height: 0;
  transition: height .35s cubic-bezier(.16, 1, .3, 1);
}

@keyframes winIn {
  from { opacity: 0; transform: translateY(22px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* The window is the old big flat card — full width, same spot;
   each newly opened app covers the previous one. */
.app-window {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--panel);
  border: none;
  border-radius: 32px;
  overflow: hidden;
  animation: winIn .32s cubic-bezier(.16, 1, .3, 1) both;
}

/* Title bar with traffic lights */
.app-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  background: var(--panel-deep);
  cursor: default;
  user-select: none;
}

.app-window-bar .wdot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.app-window-bar .wdot.close { background: #ff5f57; cursor: pointer; }
.app-window-bar .wdot.min   { background: #febc2e; }
.app-window-bar .wdot.max   { background: #28c840; }

.app-window-bar .wtitle {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  /* keep title visually centered despite the dots */
  margin-right: 48px;
}

.app-window-body { padding: 34px 44px 42px; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-tile {
  width: 66px;
  height: 66px;
  border-radius: 17px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  border: 2px solid #c7c7cc;
}

/* Category chip (LIVE / PERSONAL / COMPANY) */
.app-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.045);
  padding: 7px 14px;
  border-radius: 999px;
}

.app-tag .tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.app-name {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.008em;
  margin-top: 18px;
}

.app-award {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  margin-top: 12px;
}

.app-desc {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 580px;
}

.app-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, border-radius .25s ease,
              transform .2s ease, border-color .2s ease;
}

.app-btn:hover { transform: translateY(-1px); }

.app-btn:active {
  border-radius: 13px;
  transform: scale(.96);
}

.app-btn.solid {
  color: #fff;
  background: var(--ink);
}

.app-btn.solid:hover { background: #333336; }

.app-btn.out {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.app-btn.out:hover {
  background: #fff;
  border-color: #c7c7cc;
}

.app-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--faint);
}

.app-status .sdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7c7cc;
  display: inline-block;
}

/* Dock — icons grow from the bottom edge (JS drives --s). */
.dock {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: 14px;
  height: 110px;
}

.dock-tray {
  display: flex;
  align-items: flex-end;
  padding: 7px 9px;
  border-radius: 22px;
  background: rgba(245, 245, 247, 0.75);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.dock-item {
  --s: 1;
  --base: 52px;
  width: calc(var(--base) * var(--s));
  height: calc(var(--base) * var(--s));
  margin: 0 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.dock-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 23%;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  border: 2px solid #c7c7cc;
}

/* Pinned-app indicator, like macOS's running-app dot. */
.dock-item.selected::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
}

/* ── 9. Contact ───────────────────────────────────────────── */
#contact { padding: 150px 5vw 170px; }

.contact-h {
  font-family: var(--serif);
  font-size: clamp(34px, 6.5vw, 66px);
  font-weight: 300;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.contact-h .it {
  font-style: italic;
  color: var(--accent);
}

.contact-h .ac { color: var(--accent); }

.contact-email {
  margin: 34px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 300;
  color: var(--muted);
}

.contact-email a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 59, 48, 0.4);
  padding-bottom: 2px;
}

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.contact-social a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  transition: background .2s ease, border-radius .25s ease, transform .2s ease;
}

.contact-social a:hover { background: var(--panel-deep); }

.contact-social a:active {
  border-radius: 14px;
  transform: scale(.96);
}

/* ── 10. Footer ───────────────────────────────────────────── */
footer { padding: 0 5vw 46px; }

.foot-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 26px;
  font-size: 13px;
  color: var(--muted);
}

.foot-logo {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}

.foot-logo em {
  color: var(--accent);
  font-style: normal;
}

/* ── 11. Responsive ───────────────────────────────────────── */
@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 26px;
  }

  .hero-left {
    align-items: center;
    text-align: center;
  }

  .hero-photo {
    position: relative;
    height: 300px;
  }

  .hero-photo .frame {
    position: relative;
    aspect-ratio: auto;
    width: 220px;
    height: 280px;
    margin: 0 auto;
  }

  .hero-social {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
  }

  section { padding: 110px 6vw; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-map { width: 100%; }

  .exp-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .exp-detail-hold { position: static; }

  .exp-panel { padding: 24px; }

  .d-body,
  .d-bullet { max-width: none; }

  .app-window { width: 100%; }

  .app-window-body { padding: 20px 22px 24px; }

  .dock { height: auto; }

  .dock-tray {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  .dock-item { margin: 0; }
}

/* Small phones */
@media (max-width: 480px) {
  .dock-item { --base: 42px; }

  .app-window-body { padding: 16px 18px 22px; }

  .exp-panel { padding: 18px; }

  .stats { grid-template-columns: 1fr; }

  .stat { padding: 14px 20px; }

  .d-gallery img { height: 110px; }
  .d-gallery video { height: 190px; }
  .d-gallery.split video { height: 228px; }

  #contact { padding: 90px 6vw 110px; }
}
