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

:root {
  --bg: #f5f5f4;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  --bg: #121212;
  --card-bg: #1e1e1e;
  --text: #f5f5f4;
  --text-muted: #a0a0a0;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}

/* Noise texture overlay */
body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
  content: '';
  height: 100vh;
  left: 0;
  opacity: 0.3;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 9999;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 4px;
}

.topbar__location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  max-width: calc(100% - 50px);
  -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
}

.topbar__location-inner {
  display: flex;
  align-items: center;
  animation: marquee 60s linear infinite;
}

.marquee-segment {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.topbar__location:hover .topbar__location-inner {
  animation-play-state: paused;
}

.topbar__dot {
  opacity: 0.5;
}

#weatherIcon {
  display: flex;
  align-items: center;
}

#weatherIcon svg {
  display: block;
}

.topbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.topbar__back:hover {
  background: var(--border);
}

.topbar__back svg {
  width: 20px;
  height: 20px;
}

.topbar__back + .topbar__location {
  flex: 1;
  margin: 0 12px;
}

.topbar__theme {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.topbar__theme:hover {
  background: var(--border);
  color: var(--text);
}

.topbar__theme svg {
  width: 20px;
  height: 20px;
  display: block;
}

.topbar__theme .icon-moon {
  display: none;
}

[data-theme="dark"] .topbar__theme .icon-sun {
  display: none;
}

[data-theme="dark"] .topbar__theme .icon-moon {
  display: block;
}

/* Profile Header */
.profile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
}

.profile__name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #6366f1;
}

.profile__title {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-muted);
}

.profile__bio {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.profile__contact {
  padding: 10px 20px;
  background: var(--text);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.profile__contact:hover {
  opacity: 0.8;
}

/* Bento Grid - Split Layout */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bento__left {
  display: flex;
}

.bento__left .card {
  flex: 1;
}

.bento__right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bento__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 120px;
  gap: 12px;
}

/* Card Base */
.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Sizes */
.card--tall {
  grid-row: span 2;
}

.card--wide {
  grid-column: span 2;
}

.card--small {
  grid-column: span 1;
  grid-row: span 1;
}

/* Hero card (family photo) - no hover effect */
.card--hero {
  cursor: default;
}

.card--hero:hover {
  transform: none;
  box-shadow: var(--shadow);
}

/* Card Image */
.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Overlay */
.card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: white;
}

.card__label {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.card__desc {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 4px;
}

/* Card Icon */
.card__icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.card__icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.card__icon-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}

/* Colored card backgrounds */
.card--linkedin {
  background: #0077b5;
}

.card--github {
  background: #24292f;
}

.card--youtube {
  background: #CD201F;
}

.card--twitter {
  background: #000000;
}

.card--about {
  background: #6366f1;
}

.card--portfolio {
  background: #8b5cf6;
}

.card--stack {
  background: #06b6d4;
}

.card--resume {
  background: #10b981;
}

.card--email {
  background: #ec4899;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

/* Modal */
.bento {
  position: relative;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--card-bg);
  padding: 24px 32px;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.modal--show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal__email {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.modal__message {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 700px) {
  body {
    padding: 16px;
  }

  .profile {
    flex-wrap: wrap;
  }

  .profile__contact {
    width: 100%;
    text-align: center;
    margin-top: 12px;
  }

  .bento {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bento__left {
    height: 280px;
  }

  .bento__left .card__image {
    object-position: center;
  }

  .bento__right {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
  }
}
