@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Theme Variables ─── */
:root {
  --bg:          #ffffff;
  --bg-soft:     #f9fafb;
  --panel:       #f3f4f6;
  --card:        #f9fafb;
  --ink:         #111827;
  --muted:       #374151;
  --faint:       #6b7280;
  --line:        rgba(0, 0, 0, 0.08);
  --accent:      #111827;
  --toggle-icon: block;
  --toggle-moon: none;
}

html.dark {
  --bg:          #000000;
  --bg-soft:     #0a0a0a;
  --panel:       #111111;
  --card:        #0f0f0f;
  --ink:         #ffffff;
  --muted:       #d1d5db;
  --faint:       #9ca3af;
  --line:        rgba(255, 255, 255, 0.08);
  --accent:      #ffffff;
  --toggle-icon: none;
  --toggle-moon: block;
}

/* ─── Reset & Base ─── */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  font-size: 15px;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ink);
}

/* ─── Layout ─── */
body > header,
main,
footer {
  width: min(900px, calc(100% - 3rem));
  margin: 0 auto;
}

/* ─── Header / Nav ─── */
body > header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.35s ease;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease;
}

.site-brand h1 a {
  color: inherit;
  text-decoration: none;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

nav a {
  font-size: 0.82rem;
  color: var(--faint);
  transition: color 0.2s ease;
}

nav a.active {
  color: var(--ink);
  border: 1px solid rgba(128, 128, 128, 0.35);
  background: rgba(128, 128, 128, 0.12);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
}

nav a:hover {
  color: var(--ink);
}

/* ─── Theme Toggle Button ─── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun  { display: var(--toggle-moon); }
.theme-toggle .icon-moon { display: var(--toggle-icon); }

/* ─── Main ─── */
main {
  padding: 3rem 0 4rem;
}

/* ─── Scroll Animations ─── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger > .animate-on-scroll:nth-child(2) { transition-delay: 0.18s; }
.stagger > .animate-on-scroll:nth-child(3) { transition-delay: 0.36s; }
.stagger > .animate-on-scroll:nth-child(4) { transition-delay: 0.54s; }
.stagger > .animate-on-scroll:nth-child(5) { transition-delay: 0.72s; }
.stagger > .animate-on-scroll:nth-child(6) { transition-delay: 0.9s; }

/* ─── Hero ─── */
.hero {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 3rem;
  align-items: center;
  padding: 1rem 0 3rem;
}

.hero-text .greeting {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--faint);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.hero-text h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: color 0.35s ease;
}

.hero-text p {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Typing cursor */
.typing-cursor::after {
  content: '|';
  animation: blink 1.1s step-start infinite;
  color: var(--faint);
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-visual {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: border-color 0.35s ease, transform 0.4s ease;
}

.hero-visual:hover {
  transform: scale(1.015);
}

.hero-visual img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

/* ─── Section blocks ─── */
.section-block {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  transition: border-color 0.35s ease;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease;
}

.section-header a {
  color: var(--faint);
  font-size: 0.82rem;
}

.section-header a:hover {
  color: var(--ink);
}

/* ─── Content cards ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover {
  border-color: rgba(128, 128, 128, 0.25);
  transform: translateY(-2px);
}

.card .meta {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.5rem;
}

.card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.35s ease;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ─── Quote ─── */
.quote {
  padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--ink);
  background: var(--panel);
  border-radius: 0 0.5rem 0.5rem 0;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.quote p {
  margin: 0;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease;
}

.quote cite {
  display: block;
  margin-top: 0.6rem;
  color: var(--faint);
  font-style: normal;
  font-size: 0.85rem;
}

/* ─── Blog page ─── */
.blog-list {
  display: grid;
  gap: 1.25rem;
}

.blog-list article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 0.25s ease, background-color 0.35s ease;
}

.blog-list article:hover {
  border-color: rgba(128, 128, 128, 0.25);
}

.blog-list article h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease;
}

.blog-list article .meta {
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.blog-list article p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.blog-list article iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

/* ─── Contact page ─── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-card:hover {
  border-color: rgba(128, 128, 128, 0.25);
  transform: translateY(-2px);
}

.contact-card .label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
  transition: color 0.35s ease;
}

.contact-card .value {
  font-size: 0.82rem;
  color: var(--faint);
}

.contact-form-section h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease;
}

form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 560px;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  transition: background-color 0.35s ease, border-color 0.2s ease, color 0.35s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(128, 128, 128, 0.4);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.35s ease, color 0.35s ease;
}

button:hover,
.button:hover {
  opacity: 0.85;
  text-decoration: none;
}

/* ─── About page ─── */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.about-intro p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 1rem;
}

.photo-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.photo-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-card:nth-child(1) { transform: rotate(-3deg); }
.photo-card:nth-child(2) { transform: rotate(4deg); }

.photo-card:hover {
  transform: rotate(0deg) scale(1.03) !important;
  z-index: 2;
  border-color: rgba(128, 128, 128, 0.25);
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.photo-card .caption {
  padding: 0.6rem 0.75rem;
  background: var(--card);
  transition: background-color 0.35s ease;
}

.photo-card .caption .date {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.photo-card .caption .place {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
  transition: border-color 0.35s ease;
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.78rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  border: 2px solid var(--bg);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.timeline-item[style*="--tl-color"]::before {
  background: var(--tl-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tl-color) 20%, transparent);
}

.timeline-item h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.35s ease;
}

.timeline-item .period {
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.timeline-item .role {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}

.timeline-item .detail {
  font-size: 0.82rem;
  color: var(--faint);
  margin: 0.15rem 0 0;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover {
  border-color: rgba(128, 128, 128, 0.25);
  transform: translateY(-2px);
  text-decoration: none;
}

.project-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.35s ease;
}

.project-card p {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tags span {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.08);
  color: var(--faint);
  border: 1px solid var(--line);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* ─── Playbook / Credit Card Cards ─── */
.playbook-intro {
  max-width: 640px;
  margin-bottom: 2rem;
}

.playbook-intro p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.cc-grid {
  display: grid;
  gap: 1.25rem;
}

.cc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-card:hover {
  border-color: rgba(128, 128, 128, 0.25);
}

.cc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cc-card-top h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.35s ease;
}

.cc-card-top h4 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cc-card-top h4 a:hover {
  opacity: 0.7;
}

.cc-issuer {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-top: 0.15rem;
}

.cc-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.cc-badge.high {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.cc-badge.near {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.cc-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.cc-detail-box {
  background: var(--panel);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  transition: background-color 0.35s ease;
}

.cc-detail-box .lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-bottom: 0.3rem;
}

.cc-detail-box .val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4ade80;
}

.cc-detail-box .val.fee {
  color: #fbbf24;
}

.cc-detail-box .sub {
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 0.2rem;
}

.cc-detail-box ul {
  list-style: disc;
  padding-left: 1rem;
  margin: 0;
}

.cc-detail-box ul li {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.cc-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s ease;
}

.cc-cta:hover {
  border-color: rgba(128, 128, 128, 0.3);
  color: var(--ink);
  text-decoration: none;
}

/* ─── Page Transition ─── */
main {
  animation: pageFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Countdown Timer ─── */
.countdown-wrapper {
  text-align: center;
  padding: 1.5rem 0;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.countdown .unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.countdown .num {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 0.35s ease;
}

.countdown .lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-top: 0.2rem;
}

.countdown-label {
  font-size: 0.82rem;
  color: var(--faint);
  margin-top: 0.75rem;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  transition: border-color 0.35s ease;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--faint);
}

.footer-links a:hover {
  color: var(--ink);
}

footer .copyright {
  font-size: 0.75rem;
  color: var(--faint);
  margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .hero,
  .about-intro {
    grid-template-columns: 1fr;
  }

  .hero-visual img {
    height: 300px;
  }

  .photo-gallery {
    grid-template-columns: 1fr;
  }

  .photo-card:nth-child(1),
  .photo-card:nth-child(2) {
    transform: rotate(0deg);
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-group {
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
  }
}
