/* ============================================================
   Sayless portfolio — 이서준
   Light: #FFFFFF / #111827 / accent #6366F1
   Dark : #0B0F1A / #E5E7EB / accent #6366F1
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-elev: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-ring: rgba(99, 102, 241, 0.35);
  --danger: #dc2626;
  --success: #059669;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(17, 24, 39, 0.08), 0 2px 4px -2px rgba(17, 24, 39, 0.06);
  --shadow-lg: 0 20px 40px -20px rgba(17, 24, 39, 0.25), 0 8px 16px -8px rgba(17, 24, 39, 0.10);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --container: 1120px;
  --nav-h: 64px;
  --font-sans: "Pretendard", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-soft: #0f1524;
  --bg-elev: #121a2c;
  --border: #1f2a44;
  --border-strong: #2a3554;
  --text: #e5e7eb;
  --text-muted: #a3adc2;
  --text-subtle: #7d879e;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.18);
  --accent-ring: rgba(99, 102, 241, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, 0.7), 0 8px 16px -8px rgba(0, 0, 0, 0.5);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 320ms ease, color 320ms ease;
}

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

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: background-color 320ms ease, border-color 320ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav__logo-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -8px var(--accent);
}
.nav__logo-text { color: var(--text); font-size: 14px; }

.nav__links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav__links a { transition: color 200ms ease; }
.nav__links a:hover { color: var(--text); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.theme-toggle:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
  text-decoration: none;
  line-height: 1;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -12px var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--text); transform: translateY(-1px); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.7; cursor: not-allowed; transform: none !important; }

.btn__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 720ms linear infinite;
  display: none;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 60%;
  background:
    radial-gradient(60% 60% at 20% 20%, var(--accent-soft), transparent 70%),
    radial-gradient(50% 60% at 80% 10%, rgba(139, 92, 246, 0.14), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.hero__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero__title {
  font-size: clamp(30px, 5.6vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0;
  max-width: 22ch;
}
.accent { color: var(--accent); }
.hero__tagline {
  color: var(--text-muted);
  max-width: 60ch;
  font-size: clamp(15px, 1.6vw, 18px);
  margin: 0;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 12px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.hero__stats > div { text-align: left; }
.hero__stats dt { font-size: 12px; color: var(--text-subtle); letter-spacing: 0.02em; }
.hero__stats dd { margin: 4px 0 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Section shell ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--border); }
.section__head { margin-bottom: 40px; max-width: 720px; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section__title {
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.2;
}
.section__desc { color: var(--text-muted); margin: 0; }

/* ---------- About ---------- */
.about {
  display: grid;
  gap: 20px;
  max-width: 780px;
  color: var(--text-muted);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.8;
}
.about p { margin: 0; }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skills__group {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.skills__group:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.skills__group h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 260ms cubic-bezier(.2,.7,.2,1), box-shadow 260ms ease, border-color 260ms ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card__thumb {
  aspect-ratio: 16 / 10;
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), rgba(139, 92, 246, 0.1));
  overflow: hidden;
}
.card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 60% at 20% 30%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(60% 60% at 80% 70%, rgba(99, 102, 241, 0.25), transparent 60%);
  mix-blend-mode: overlay;
}
html[data-theme="dark"] .card__thumb::after {
  background:
    radial-gradient(50% 60% at 20% 30%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(60% 60% at 80% 70%, rgba(99, 102, 241, 0.35), transparent 60%);
}
.card__thumb-label {
  position: absolute;
  left: 16px; bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.card__thumb-icon {
  position: absolute;
  right: 16px; top: 16px;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  display: grid; place-items: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .card__thumb-icon { background: rgba(11,15,26,0.85); color: #fff; }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.card__desc { color: var(--text-muted); margin: 0; font-size: 14px; line-height: 1.7; }
.card__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.card__tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 32px;
  align-items: start;
}
.contact__info,
.contact__form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.contact__info h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.contact__info ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.contact__info li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; color: var(--text); font-size: 14px; }
.contact__info li span { color: var(--text-subtle); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; align-self: center; }
.contact__info li a { color: var(--accent); font-weight: 600; word-break: break-all; }
.contact__note {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
}
.contact__note strong { display: block; margin-bottom: 4px; font-size: 14px; }
.contact__note p { margin: 0; font-size: 13px; color: var(--text-muted); }

.contact__form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.field textarea { resize: vertical; min-height: 128px; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-subtle); }
.field input:hover,
.field textarea:hover { border-color: var(--text-subtle); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}
.field__error { color: var(--danger); font-size: 12px; margin: 0; min-height: 1em; }
.contact__hint { font-size: 12px; color: var(--text-subtle); margin: 0; text-align: center; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-subtle);
  font-size: 13px;
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__meta { margin: 0; }
.footer p { margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  pointer-events: auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px;
  animation: toast-in 260ms ease both;
}
.toast--success { border-left: 4px solid var(--success); }
.toast--error { border-left: 4px solid var(--danger); }
.toast__title { font-weight: 700; margin: 0 0 2px; }
.toast__msg { margin: 0; color: var(--text-muted); font-size: 13px; }
.toast.is-leaving { animation: toast-out 220ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav__logo-text { display: none; }
  .nav__links { gap: 14px; font-size: 13px; }
  .hero__stats { grid-template-columns: 1fr; gap: 12px; }
  .hero__stats > div { padding: 4px 0; border-bottom: 1px dashed var(--border); }
  .hero__stats > div:last-child { border-bottom: 0; }
  .contact__info,
  .contact__form { padding: 20px; border-radius: 20px; }
  .contact__info li { grid-template-columns: 1fr; gap: 2px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .nav__links { display: none; }
  .theme-toggle__label { display: none; }
  .theme-toggle { padding: 8px; }
}
