/* ============================================
   Mila Tay — personal site
   Lightweight, dependency-free stylesheet
   ============================================ */

:root {
  --bg: #faf9f7;
  --bg-alt: #ffffff;
  --text: #1f2328;
  --text-muted: #5c6570;
  --accent: #0f766e;        /* teal */
  --accent-soft: #ccfbf1;
  --border: #e5e2dc;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --bg-alt: #1a1f26;
    --text: #e8e6e3;
    --text-muted: #9aa4af;
    --accent: #2dd4bf;
    --accent-soft: #134e4a;
    --border: #2a313a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

html[lang="zh-Hans"] {
  --font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-serif: "Fraunces", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h2 { font-size: 1.9rem; margin-top: 0; }
h3 { font-size: 1.25rem; }

.muted { color: var(--text-muted); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 1.75rem; }

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin-bottom: 1rem;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero-photo img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid var(--accent);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0c1210; } }
.btn-ghost { color: var(--accent); background: transparent; }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-3px); }

.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.card-body { padding: 1.25rem 1.5rem 1.5rem; }
.card-body h3 { margin-top: 0; }
.card-body ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.chip {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}
@media (prefers-color-scheme: dark) { .chip { color: #99f6e4; } }

/* ---------- Timeline (Experience) ---------- */
.timeline {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline > li {
  position: relative;
  padding: 0 0 2.75rem 2.25rem;
}
.timeline > li:last-child { padding-bottom: 0; }

.timeline > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

.timeline li ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }

.timeline .role { font-size: 1.2rem; margin-bottom: 0.15rem; }
.timeline .meta { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 0.75rem; }

.timeline .attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.timeline .attachments figure { margin: 0; max-width: 260px; }
.timeline .attachments img {
  border-radius: 10px;
  border: 1px solid var(--border);
}
.timeline .attachments figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ---------- Gallery ---------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 2rem;
}

.filter-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) { .filter-btn.active { color: #0c1210; } }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-item.hidden { display: none; }

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 1rem 0.9rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
}
.gallery-caption strong { display: block; font-size: 1rem; }
.gallery-caption span { font-size: 0.85rem; opacity: 0.85; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.contact-list { list-style: none; margin: 1.5rem 0; padding: 0; }
.contact-list li { margin-bottom: 0.6rem; }
.contact-list strong { display: inline-block; min-width: 90px; }

.map-embed {
  border: 0;
  border-radius: var(--radius);
  width: 100%;
  height: 260px;
  box-shadow: var(--shadow);
}

.form-field { margin-bottom: 1.1rem; }

.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}
.checkbox-field input { accent-color: var(--accent); }

/* ---------- Social links ---------- */
.social-row { display: flex; gap: 1rem; margin-top: 1rem; }

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 1.15rem;
  transition: all 0.15s ease;
}
.social-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 3rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.site-footer .social-row { margin: 0; }
.site-footer .social-row a { width: 38px; height: 38px; font-size: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { max-width: 380px; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.88rem; }
}

@media (max-width: 520px) {
  .site-header .wrap { flex-direction: column; height: auto; padding-top: 0.75rem; padding-bottom: 0.75rem; gap: 0.4rem; }
}
