/* =========================
   Ray Hong Portfolio Styles
   Light + Dark Mode
   ========================= */

/* ---------- Theme Tokens ---------- */
:root {
  /* Brand / Accent */
  --accent: #0d9488;            /* teal */
  --accent-2: #22c55e;          /* subtle green */
  --ring: rgba(13, 148, 136, 0.35);

  /* Light theme */
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.10);

  /* Effects */
  --shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
  --shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.10);
  --radius: 16px;
  --radius-sm: 12px;

  /* Layout */
  --max: 1040px;
  --pad: 20px;

  /* Type */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
          "Segoe UI Emoji";
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #0f172a;
  --surface-2: #111c33;
  --text: #e5e7eb;
  --muted: #a3b0c2;
  --border: rgba(226, 232, 240, 0.12);

  --shadow: 0 14px 34px rgba(0, 0, 0, 0.40);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ---------- Base Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Make inline SVG use currentColor nicely */
svg { display: block; }

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

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 10px;
}

/* ---------- Utilities ---------- */
.container {
  max-width: var(--max);
  padding: 0 var(--pad);
  margin: 0 auto;
}

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

.eyebrow {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Topbar / Nav ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.70);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px rgba(13, 148, 136, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav a {
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}

.nav a:hover {
  background: rgba(13, 148, 136, 0.10);
  color: var(--text);
  transform: translateY(-1px);
}

/* Theme toggle button (top-right) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.04);
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}

.theme-toggle:hover { transform: translateY(-1px); }

.toggle-icon { font-size: 16px; line-height: 1; }
.toggle-text { font-weight: 800; font-size: 14px; }

/* Mobile nav behavior */
@media (max-width: 820px) {
  .nav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 34px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 12px 0 0;
  font-weight: 800;
  color: var(--muted);
  font-size: 18px;
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  max-width: 56ch;
}

/* CTA Buttons */
.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 900;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 26px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 18px 34px rgba(13, 148, 136, 0.30);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.05);
}

.btn-outline:hover {
  border-color: rgba(13, 148, 136, 0.35);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.05);
}

.btn-secondary:hover {
  border-color: rgba(13, 148, 136, 0.35);
}

/* Social pills */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  transition: transform 120ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.pill:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 148, 136, 0.35);
  color: var(--text);
}

/* Hero illustration (SVG container) */
.hero-art {
  display: grid;
  justify-items: end;
}

.hero-illustration {
  width: min(520px, 100%);
  aspect-ratio: 640 / 420;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(13,148,136,0.10), rgba(34,197,94,0.06));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

:root[data-theme="dark"] .hero-illustration {
  background: linear-gradient(135deg, rgba(13,148,136,0.14), rgba(34,197,94,0.07));
}

.hero-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Responsive hero */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    justify-items: start;
  }
}

@media (max-width: 540px) {
  .hero { padding-top: 46px; }
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
}

.section.alt {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.section p { margin: 0 0 24px; }

/* ---------- Cards (Projects) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.05);
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(13, 148, 136, 0.25);
}

.card-accent {
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.card h3 {
  margin: 10px 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.14);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
}

:root[data-theme="dark"] .tag {
  background: rgba(13, 148, 136, 0.10);
  border-color: rgba(13, 148, 136, 0.22);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: var(--accent);
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.14);
  transition: transform 120ms ease, background 160ms ease;
}

.card-link:hover {
  transform: translateY(-1px);
  background: rgba(13, 148, 136, 0.10);
}

@media (max-width: 980px) {
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Skills Grid ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.05);
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list li { margin: 6px 0; }

@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Timeline (Experience) ---------- */
.timeline {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.time-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 20px rgba(13, 148, 136, 0.18);
}

.time-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.05);
}

.time-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
}

.contact .cta-row {
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer a {
  color: var(--muted);
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 160ms ease, color 160ms ease;
}

.footer a:hover {
  background: rgba(13, 148, 136, 0.10);
  color: var(--text);
}

.footer-note {
  margin: 12px 0 0;
  padding-bottom: 6px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.footer-note a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-note a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

/* ---------- Optional: Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}

/* ---------- Private repo label ---------- */
.card-link.private {
  display: inline-block;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
}
