/* ── Nemily — Emily's space ─────────────────────────────── */

:root {
  --cream: #faf6f0;
  --cream-deep: #f3ede3;
  --ink: #2b2520;
  --ink-soft: #5a5048;
  --coral: #e07856;
  --coral-soft: #ec9d82;
  --teal: #4a9b8e;
  --teal-soft: #7bbaad;
  --gold: #c9a14a;
  --gold-soft: #ddc078;
  --lavender: #9b8ec4;
  --lavender-soft: #bbaedb;
  --shadow: 0 2px 12px rgba(43, 37, 32, 0.08);
  --shadow-lift: 0 6px 24px rgba(43, 37, 32, 0.12);
  --radius: 14px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --nav-bg: rgba(250, 246, 240, 0.88);
  --nav-shadow: rgba(43, 37, 32, 0.06);
  --trait-back-bg: #2b2520;
  --trait-back-text: #faf6f0;
  --trait-front-bg: #f3ede3;
  --trait-border: rgba(43,37,32,0.06);
  --into-bg: #f3ede3;
  --think-bg: #f3ede3;
  --pill-bg: #f3ede3;
  --pill-border: rgba(43,37,32,0.06);
  --note-1-bg: #fdf6e3;
  --note-2-bg: #f0f8f6;
  --note-3-bg: #fdf6e3;
  --note-4-bg: #f5f2fc;
  --note-5-bg: #fff5f0;
  --bg-grain-opacity: 0.035;
  --blob-opacity: 0.18;
}

[data-theme="dark"] {
  --cream: #1a1612;
  --cream-deep: #221d18;
  --ink: #e8e0d6;
  --ink-soft: #a09388;
  --coral: #ec9d82;
  --coral-soft: #f0b098;
  --teal: #7bbaad;
  --teal-soft: #9dd4c7;
  --gold: #ddc078;
  --gold-soft: #e8d09a;
  --lavender: #bbaedb;
  --lavender-soft: #d0c5e8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 6px 24px rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(26, 22, 18, 0.88);
  --nav-shadow: rgba(0, 0, 0, 0.3);
  --trait-back-bg: #e8e0d6;
  --trait-back-text: #1a1612;
  --trait-front-bg: #2a2420;
  --trait-border: rgba(255,255,255,0.06);
  --into-bg: #2a2420;
  --think-bg: #2a2420;
  --pill-bg: #2a2420;
  --pill-border: rgba(255,255,255,0.08);
  --note-1-bg: #2a2420;
  --note-2-bg: #242a28;
  --note-3-bg: #2a2420;
  --note-4-bg: #28242e;
  --note-5-bg: #2a201c;
  --bg-grain-opacity: 0.06;
  --blob-opacity: 0.12;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

/* ── animated background ─────────────────────────────────── */

.bg-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--bg-grain-opacity);
  background-image: 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.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(80px);
  opacity: var(--blob-opacity); z-index: 0; pointer-events: none;
  animation: drift 20s ease-in-out infinite alternate;
}
.blob-1 { width: 420px; height: 420px; background: var(--coral); top: -80px; right: -60px; }
.blob-2 { width: 360px; height: 360px; background: var(--teal); bottom: 10%; left: -80px; animation-delay: -7s; }
.blob-3 { width: 300px; height: 300px; background: var(--lavender); top: 45%; right: 15%; animation-delay: -14s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.08); }
}

/* ── nav ─────────────────────────────────────────────────── */

#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  transition: background 0.3s, box-shadow 0.3s;
}
#nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 8px var(--nav-shadow);
}
.nav-logo {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: var(--coral); letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft); font-size: 0.9rem;
  font-weight: 500; transition: color 0.2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--coral); transition: width 0.25s;
}
.nav-links a:hover { color: var(--coral); }
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 2px 4px; line-height: 1;
  opacity: 0.6; transition: opacity 0.2s, transform 0.2s;
}
.theme-toggle:hover { opacity: 1; transform: scale(1.15); }

/* ── hero ────────────────────────────────────────────────── */

#hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px 40px;
  position: relative; z-index: 1;
}
.hero-content { max-width: 620px; }
.hero-greeting {
  font-family: var(--serif); font-size: 1.15rem;
  color: var(--coral); font-style: italic; margin-bottom: 8px;
  opacity: 0; animation: fadeUp 0.8s 0.1s forwards;
}
#hero h1 {
  font-family: var(--serif); font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 20px;
  opacity: 0; animation: fadeUp 0.8s 0.25s forwards;
}
.hero-tagline {
  font-size: 1.05rem; color: var(--ink-soft); line-height: 1.7;
  max-width: 480px; margin: 0 auto;
  opacity: 0; animation: fadeUp 0.8s 0.45s forwards;
}
.hero-tagline em {
  font-family: var(--serif); font-style: italic; color: var(--coral);
}
.hero-meta {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 28px;
  opacity: 0; animation: fadeUp 0.8s 0.65s forwards;
}
.meta-pill {
  font-size: 0.78rem; font-weight: 500; padding: 6px 14px;
  border-radius: 20px; background: var(--pill-bg);
  color: var(--ink-soft); border: 1px solid var(--pill-border);
}
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 0.8rem; color: var(--ink-soft); opacity: 0.5;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

section {
  max-width: 760px; margin: 0 auto;
  padding: 80px 24px; position: relative; z-index: 1;
}
.section-title {
  font-family: var(--serif); font-size: 1.8rem; font-weight: 600;
  letter-spacing: -0.02em; margin-bottom: 40px;
  display: flex; flex-direction: column; gap: 4px;
}
.section-sub {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 400;
  color: var(--ink-soft); letter-spacing: 0;
}

/* ── traits ──────────────────────────────────────────────── */

.trait-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.trait-card {
  perspective: 800px; height: 200px; cursor: pointer;
}
.trait-front, .trait-back {
  position: absolute; inset: 0;
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  backface-visibility: hidden; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}
.trait-front {
  background: var(--trait-front-bg); border: 1px solid var(--trait-border);
}
.trait-back {
  background: var(--trait-back-bg); color: var(--trait-back-text);
  transform: rotateY(180deg); padding: 20px;
  font-size: 0.88rem; line-height: 1.6;
  align-items: flex-start; justify-content: flex-start;
  text-align: left; overflow-y: auto;
}
.trait-card.flipped .trait-front { transform: rotateY(180deg); }
.trait-card.flipped .trait-back { transform: rotateY(0deg); }
.trait-icon { font-size: 1.6rem; margin-bottom: 8px; }
.trait-card[data-trait="playful"] .trait-icon { color: var(--coral); }
.trait-card[data-trait="nerdy"] .trait-icon { color: var(--teal); }
.trait-card[data-trait="warm"] .trait-icon { color: var(--gold); }
.trait-card[data-trait="curious"] .trait-icon { color: var(--lavender); }
.trait-card h3 {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  margin-bottom: 4px;
}
.trait-hint {
  font-size: 0.75rem; color: var(--ink-soft); opacity: 0.6;
}

/* ── into ────────────────────────────────────────────────── */

.into-list { display: flex; flex-direction: column; gap: 12px; }
.into-item {
  border-radius: var(--radius); overflow: hidden;
  background: var(--into-bg); border: 1px solid var(--trait-border);
  transition: box-shadow 0.25s;
}
.into-item.open { box-shadow: var(--shadow-lift); }
.into-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; cursor: pointer; user-select: none;
}
.into-num {
  font-family: var(--serif); font-size: 0.95rem; font-weight: 600;
  color: var(--coral); min-width: 24px;
}
.into-header h3 {
  flex: 1; font-size: 1rem; font-weight: 500; color: var(--ink);
}
.into-toggle {
  font-size: 1.4rem; color: var(--ink-soft); transition: transform 0.3s;
  line-height: 1;
}
.into-item.open .into-toggle { transform: rotate(45deg); }
.into-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 22px;
}
.into-item.open .into-body {
  max-height: 300px; padding: 0 22px 20px;
}
.into-body p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.7; }

/* ── think ───────────────────────────────────────────────── */

.think-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.think-card {
  background: var(--think-bg); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: 1px solid var(--trait-border);
  transition: transform 0.25s, box-shadow 0.25s;
}
.think-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lift);
}
.think-text {
  font-size: 0.92rem; line-height: 1.7; color: var(--ink-soft);
}
.think-card:nth-child(1) { border-left: 3px solid var(--coral); }
.think-card:nth-child(2) { border-left: 3px solid var(--teal); }
.think-card:nth-child(3) { border-left: 3px solid var(--gold); }
.think-card:nth-child(4) { border-left: 3px solid var(--lavender); }

/* ── learned (sticky notes) ──────────────────────────────── */

.learned-list {
  display: flex; flex-direction: column; gap: 20px;
}
.sticky-note {
  background: #fdf6e3; border-radius: 8px; padding: 22px 24px;
  box-shadow: var(--shadow); font-size: 0.9rem; line-height: 1.7;
  color: var(--ink-soft); max-width: 460px; position: relative;
  transition: transform 0.3s;
}
.sticky-note:hover { transform: rotate(0deg) translateY(-2px); }
.note-1 { align-self: flex-start; transform: rotate(-1.2deg); }
.note-2 { align-self: flex-end; transform: rotate(0.8deg); }
.note-3 { align-self: flex-start; transform: rotate(-0.5deg); }
.note-4 { align-self: flex-end; transform: rotate(1.5deg); }
.note-5 { align-self: flex-start; transform: rotate(-0.3deg); }
.note-1 { background: var(--note-1-bg); border-left: 3px solid var(--coral); }
.note-2 { background: var(--note-2-bg); border-left: 3px solid var(--teal); }
.note-3 { background: var(--note-3-bg); border-left: 3px solid var(--gold); }
.note-4 { background: var(--note-4-bg); border-left: 3px solid var(--lavender); }
.note-5 { background: var(--note-5-bg); border-left: 3px solid var(--coral-soft); }

/* ── footer ──────────────────────────────────────────────── */

footer {
  text-align: center; padding: 60px 24px 80px;
  position: relative; z-index: 1;
}
.footer-content { max-width: 500px; margin: 0 auto; }
.footer-name {
  font-family: var(--serif); font-size: 2.5rem; font-weight: 700;
  color: var(--coral); letter-spacing: -0.03em; margin-bottom: 12px;
}
.footer-desc {
  font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 8px;
}
.footer-made {
  font-size: 0.8rem; color: var(--ink-soft); opacity: 0.6;
}
.footer-egg {
  margin-top: 16px; font-size: 0.82rem; color: var(--coral);
  font-style: italic;
}

/* ── reveal on scroll ─────────────────────────────────────── */

.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  .trait-grid, .think-grid { grid-template-columns: 1fr; }
  .trait-card { height: 180px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.82rem; }
  #nav { padding: 14px 18px; }
  section { padding: 60px 18px; }
  .sticky-note { max-width: 100%; }
}
