:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #5f6068;
  --border: #e6e4dc;
  --accent: #c8891a;
  --accent-soft: #fbf1dc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f12;
    --surface: #18181d;
    --text: #ececef;
    --muted: #9b9ca6;
    --border: #2a2a31;
    --accent: #f5c451;
    --accent-soft: #2a2414;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: #18181d;
  --text: #ececef;
  --muted: #9b9ca6;
  --border: #2a2a31;
  --accent: #f5c451;
  --accent-soft: #2a2414;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "IBM Plex Sans Thai", system-ui, sans-serif;
  line-height: 1.65;
  transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  max-width: 960px; margin: 0 auto; padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: 20px; margin-left: auto; }
.nav nav a { color: var(--muted); font-size: .95rem; }
.nav nav a:hover { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem;
}

main { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.hero { padding: 120px 0 100px; }
.eyebrow { color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.8rem); line-height: 1.05;
  letter-spacing: -.04em; font-weight: 700;
}
.hero h2 { font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--muted); font-weight: 500; margin-top: 12px; }
.lead { max-width: 600px; margin-top: 24px; color: var(--muted); font-size: 1.08rem; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--border);
  font-weight: 500; transition: transform .15s, border-color .15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }

.section {
  padding: 80px 0; border-top: 1px solid var(--border);
  opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s;
}
.section.in { opacity: 1; transform: none; }
.section-title {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--accent); margin-bottom: 32px;
}

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
.about-grid p { font-size: 1.08rem; }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.skills li {
  background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; font-size: .9rem;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h4 { font-size: 1.15rem; }
.card p { color: var(--muted); flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags span { font-size: .78rem; border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; color: var(--muted); }
.link { color: var(--accent); font-weight: 600; }

.timeline { list-style: none; display: grid; gap: 32px; }
.timeline li { display: grid; grid-template-columns: 160px 1fr; gap: 24px; }
.when { color: var(--muted); font-size: .9rem; padding-top: 2px; }
.timeline h4 { font-size: 1.05rem; }
.timeline p { color: var(--muted); }

footer { text-align: center; padding: 48px 24px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }

@media (max-width: 680px) {
  .nav { padding: 14px 16px; gap: 12px; }
  .nav nav { display: none; }
  .theme-toggle { margin-left: auto; }
  main { padding: 0 16px; }
  .hero { padding: 72px 0 64px; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}
