:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text-primary: #262626;
  --text-secondary: #8e8e8e;
  --text-tertiary: #b2b2b2;
  --border: #efefef;
  --font: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 935px;
  --nav-height: 54px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
}

/* ── Navigation ─────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.site-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav__globe {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.site-nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.site-nav__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.site-nav__links a:hover,
.site-nav__links a.active {
  color: var(--text-primary);
}

/* ── Page wrapper ────────────────────────────────── */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.page-header p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Post grid ───────────────────────────────────── */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

@media (max-width: 600px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Post card ───────────────────────────────────── */

.post-card {
  cursor: pointer;
  position: relative;
  background: var(--border);
  overflow: hidden;
  aspect-ratio: 1;
}

.post-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.post-card:hover .post-card__cover {
  opacity: 0.9;
}

.post-card__badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.post-card__badge {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Story sections ──────────────────────────────── */

.stories-page .year-section {
  margin-bottom: 52px;
}

.stories-page .year-heading {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

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

@media (max-width: 480px) {
  .story-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.story-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--border);
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
}

.story-thumb__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.story-thumb:hover .story-thumb__media {
  opacity: 0.9;
}

.story-thumb__media--video {
  background: #1a1a1a;
}

.story-thumb__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.story-thumb__play svg {
  width: 28px;
  height: 28px;
  fill: rgba(255,255,255,0.85);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.story-thumb__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 8px 8px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.55));
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Lightbox ────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.open {
  display: flex;
}

.lightbox__inner {
  display: flex;
  width: 100%;
  max-width: 1060px;
  max-height: calc(100vh - 32px);
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.lightbox__media-side {
  flex: 1;
  min-width: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.lightbox__media-side img,
.lightbox__media-side video {
  max-width: 100%;
  max-height: calc(100vh - 32px);
  object-fit: contain;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
  backdrop-filter: blur(4px);
}

.lightbox__nav:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__nav:disabled { opacity: 0; pointer-events: none; }

.lightbox__counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.lightbox__sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.lightbox__sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.lightbox__timestamp {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.lightbox__location {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.lightbox__caption {
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.lightbox__caption:empty {
  display: none;
}

.lightbox__exif {
  border-top: 1px solid var(--border);
  padding: 0;
}

.lightbox__exif summary {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lightbox__exif summary::-webkit-details-marker { display: none; }

.lightbox__exif-rows {
  padding: 0 20px 16px;
}

.lightbox__exif-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.lightbox__exif-row:last-child { border-bottom: none; }

.lightbox__exif-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lightbox__exif-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  backdrop-filter: blur(4px);
  z-index: 1;
  transition: background 0.15s;
}

.lightbox__close:hover {
  background: rgba(0,0,0,0.75);
}

@media (max-width: 768px) {
  .lightbox {
    padding: 0;
  }

  .lightbox__inner {
    flex-direction: column;
    max-height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }

  .lightbox__media-side {
    max-height: 65vh;
  }

  .lightbox__sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 35vh;
  }
}

/* ── About page ──────────────────────────────────── */

.about-profile {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  margin-bottom: 48px;
}

.about-profile__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.about-profile__info {
  padding-top: 8px;
}

.about-profile__username {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.about-profile__name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.about-profile__bio {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 14px;
}

.about-profile__link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #00376b;
}

.about-stats {
  display: flex;
  gap: 40px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.about-stat {
  text-align: center;
}

.about-stat__number {
  font-size: 18px;
  font-weight: 600;
}

.about-stat__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .about-profile {
    flex-direction: column;
    gap: 20px;
  }
  .about-stats {
    gap: 24px;
  }
}

/* ── About hero (3D head gif) ────────────────────── */

.about-hero {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  overflow: hidden;
}

.about-hero__gif {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  .about-hero {
    padding: 24px 0;
  }
  .about-hero__gif {
    max-width: 100%;
  }
}

/* ── About note ──────────────────────────────────── */

.about-note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
}

.about-note a {
  font-weight: 600;
  color: var(--text-primary);
}

.about-note a:hover {
  text-decoration: underline;
}

/* ── About TTTT section ──────────────────────────── */

.about-tttt {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.about-tttt__gif {
  width: 160px;
  height: auto;
  display: block;
}

.about-tttt__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.about-tttt__link:hover {
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .about-tttt__gif {
    width: 120px;
  }
}

/* ── Stories footer (pedestal gif) ──────────────── */

.stories-footer {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 40px 20px 0;
  overflow: hidden;
}

.stories-footer__gif {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  .stories-footer__gif {
    max-width: 260px;
  }
}
