/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #0c1322;
  --ink-soft: #334155;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-mid: #dbeafe;
  --blue-strong: #1d4ed8;
  --teal: #0d9488;
  --amber: #d97706;
  --line: #e2e8f0;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.11), 0 4px 16px rgba(15, 23, 42, 0.05);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #ffffff 0%, #f4f6fb 45%, #edf2f9 100%);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { overflow-wrap: anywhere; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}

/* ─── Navigation ────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 66px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
  flex-shrink: 0;
}

nav { display: flex; gap: 4px; }

.nav-link,
.connect a,
.compact {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
}

.nav-link:hover,
.connect a:hover,
.compact:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.nav-link.active {
  background: var(--blue-mid);
  color: var(--blue-strong);
  font-weight: 700;
}

.nav-link.active svg {
  filter: drop-shadow(0 0 5px var(--blue)) drop-shadow(0 0 10px var(--blue));
}

/* ─── Language Toggle ───────────────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-btn {
  min-height: 32px;
  padding: 0 11px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.lang-btn:first-child {
  border-right: 1px solid var(--line);
}

.lang-btn.active {
  background: var(--blue);
  color: #fff;
}

.lang-btn:not(.active):hover {
  background: var(--blue-light);
  color: var(--blue);
}

.connect {
  display: none;
  align-items: center;
  gap: 2px;
}

.connect p {
  margin: 0 10px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.copyright {
  display: none;
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
main {
  padding: 36px 36px 60px;
  max-width: 1380px;
  margin: 0 auto;
}

.section { scroll-margin-top: 88px; }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(200px, 256px) minmax(320px, 1fr);
  gap: 52px;
  align-items: center;
  min-height: 292px;
  justify-content: center;
  padding: 8px 0 24px;
}

.portrait-wrap {
  display: flex;
  justify-content: center;
}

.portrait {
  width: min(100%, 256px);
  aspect-ratio: 0.85;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 3px solid rgba(255, 255, 255, 0.95);
  outline: 1px solid var(--line);
  background: var(--blue-light);
}

.hero-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.0;
  letter-spacing: -2px;
  font-weight: 900;
  color: var(--ink);
}

.hero-copy h2 {
  margin: 12px 0 16px;
  font-size: 19px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.2px;
}

.intro {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.primary-button,
.ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 0 18px;
  font-weight: 600;
  font-size: 14px;
  background: #fff;
  color: var(--ink-soft);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #3b82f6, #2563eb 55%, #1d4ed8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.primary-button:hover {
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.ghost-button:hover {
  border-color: #c7d6ea;
  background: var(--blue-light);
  color: var(--blue);
}

.compact {
  width: 100%;
  border: 0;
  background: transparent;
  justify-content: flex-start;
  font-weight: 500;
  font-size: 14px;
  padding: 0 14px;
}

/* ─── Panel ─────────────────────────────────────────────────────────────── */
.panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ─── Journey / Education Grid ──────────────────────────────────────────── */
.journey-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.timeline-panel,
.detail-panel {
  min-height: 400px;
  min-width: 0;
}

.timeline-panel { padding: 28px 28px 24px; }

/* ─── Section Heading ───────────────────────────────────────────────────── */
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue);
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.section-heading p:not(.section-eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ─── Timeline ──────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 148px;
}

.timeline-entry { position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 129px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  background: transparent;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.timeline-item:hover {
  background: var(--blue-mid);
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  border: none;
  z-index: 1;
  transition: background 140ms ease;
}

.timeline-item.active {
  border-color: #bfdbfe;
  background: var(--blue-light);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.timeline-item.active::before {
  background: var(--blue);
}

.timeline-period {
  position: absolute;
  left: -148px;
  top: 50%;
  transform: translateY(-50%);
  width: 112px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
  line-height: 1.4;
}

.timeline-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.35;
}

.timeline-org {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.timeline-duration {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-strong);
  background: var(--blue-mid);
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
}

/* ─── Station Icon / Logo ───────────────────────────────────────────────── */
.station-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  overflow: hidden;
  flex-shrink: 0;
}

.station-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.timeline-copy { min-width: 0; }

.accordion-indicator {
  display: none;
  color: var(--muted);
  transition: transform 160ms ease;
}

.timeline-item[aria-expanded="true"] .accordion-indicator {
  transform: rotate(180deg);
}

.timeline-accordion { display: none; }

/* ─── Detail Panel ──────────────────────────────────────────────────────── */
.detail-panel {
  padding: 28px;
  border-left: 4px solid var(--blue);
  overflow-y: auto;
}

.detail-heading {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}

.detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.detail-logo-img { padding: 5px; }

.detail-panel h2,
.timeline-accordion h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.detail-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 4px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-duration {
  font-weight: 700;
  color: var(--blue-strong);
  background: var(--blue-mid);
  border-radius: 5px;
  padding: 2px 9px;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.detail-section p,
.detail-section li {
  color: var(--ink-soft);
  line-height: 1.68;
  font-size: 14px;
  margin: 0;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.detail-section li { margin-bottom: 5px; }

/* ─── Tags ──────────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid #c7d5e8;
  background: var(--blue-light);
  color: #1e40af;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

/* ─── Skills ────────────────────────────────────────────────────────────── */
#skills {
  margin-top: 28px;
  padding: 28px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.skill-card h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 11px 16px;
  background: var(--blue-light);
  color: var(--blue-strong);
  border-bottom: 1px solid var(--blue-mid);
}

.skill-card:nth-child(2) h3 {
  background: #f0fdf4;
  color: #065f46;
  border-bottom-color: #a7f3d0;
}

.skill-card:nth-child(3) h3 {
  background: #fffbeb;
  color: #92400e;
  border-bottom-color: #fde68a;
}

.skill-card .tags {
  padding: 14px 16px;
  gap: 7px;
}

.skill-card:nth-child(2) .tag {
  background: #f0fdf4;
  border-color: #a7f3d0;
  color: #065f46;
}

.skill-card:nth-child(3) .tag {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ─── About / Contact ───────────────────────────────────────────────────── */
.about-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
}

.about-contact .panel { padding: 28px; }

.contact-list { display: grid; gap: 10px; }

.contact-list a {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  color: var(--ink-soft);
  background: #fff;
  font-weight: 500;
  font-size: 14px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.contact-list a:hover {
  background: var(--blue-light);
  border-color: var(--blue-mid);
  color: var(--blue);
}

/* ─── Admin ─────────────────────────────────────────────────────────────── */
.admin { margin-top: 28px; }

.backend-corner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 35;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  opacity: 0.35;
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.backend-corner:hover,
.backend-corner:focus-visible,
.backend-corner.is-authenticated {
  opacity: 1;
  color: var(--blue);
  background: #fff;
}

.backend-corner:hover { transform: translateY(-2px); }

.is-hidden { display: none !important; }

.admin-shell {
  background: #0f172a;
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.admin-intro { margin-bottom: 24px; }

.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-intro h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.logout-button {
  background: transparent;
  color: #fff;
  border-color: rgba(226, 232, 240, 0.22);
}

.admin-intro p:not(.eyebrow) {
  color: #94a3b8;
  line-height: 1.65;
  font-size: 14px;
}

.station-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.station-form label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.station-form .wide { grid-column: 1 / -1; }

.station-form input,
.station-form textarea,
.station-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 10px 12px;
  min-height: 42px;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.station-form input:focus,
.station-form textarea:focus,
.station-form select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.station-form textarea { resize: vertical; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions .ghost-button {
  background: transparent;
  color: #fff;
  border-color: rgba(226, 232, 240, 0.22);
}

.form-actions .ghost-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(226, 232, 240, 0.4);
  color: #fff;
}

.admin-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 140ms ease;
}

.admin-item:hover { background: rgba(255, 255, 255, 0.09); }

.admin-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.admin-item p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}

.admin-item p svg { width: 14px; height: 14px; }
.admin-actions { display: flex; gap: 8px; }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  transition: background 140ms ease;
}

.icon-button:hover { background: rgba(255, 255, 255, 0.14); }
.icon-button.danger { color: #fca5a5; }
.icon-button.danger:hover { background: rgba(239, 68, 68, 0.15); }

/* ─── Login Modal ───────────────────────────────────────────────────────── */
/* ─── Site Gate ─────────────────────────────────────────────────────────── */
.site-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f6fb 45%, #edf2f9 100%);
}

.site-gate.is-hidden {
  display: none;
}

.site-gate-card {
  width: min(100%, 380px);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226, 232, 240, 0.7);
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.site-gate-avatar {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid var(--blue-mid);
  box-shadow: 0 0 0 4px var(--blue-light);
  margin-bottom: 18px;
  flex-shrink: 0;
}

.site-gate-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-gate-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.site-gate-sub {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.site-gate-form {
  width: 100%;
  display: grid;
  gap: 12px;
}

.site-gate-label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.site-gate-input {
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.site-gate-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.site-gate-btn {
  width: 100%;
  justify-content: center;
}

.site-gate-error {
  min-height: 18px;
  margin: 0;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ─── Login Modal ────────────────────────────────────────────────────────── */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-card {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.28);
  padding: 32px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--muted);
  background: #f8fafc;
  border-color: var(--line);
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.login-copy {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.login-form { display: grid; gap: 14px; }

.login-form label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-form input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.25);
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 500;
  z-index: 30;
}

/* ─── SVG / Icon helpers ────────────────────────────────────────────────── */
svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.nav-link span,
.connect span,
button span,
.meta-row svg,
.contact-list span {
  flex: 0 0 auto;
}

/* ─── Breakpoint: Tablet ────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .hero,
  .journey-grid,
  .about-contact {
    grid-template-columns: 1fr;
  }

  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── Breakpoint: Mobile ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar {
    padding: 12px 16px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: auto;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 18px;
  }

  nav {
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  nav::-webkit-scrollbar { display: none; }

  .nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 13px;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    white-space: nowrap;
    font-size: 13px;
  }

  .connect, .copyright { display: none; }

  .lang-toggle {
    align-self: flex-end;
    margin-bottom: 2px;
  }

  main { padding: 20px 16px 52px; }

  .section { scroll-margin-top: 122px; }

  .hero {
    gap: 22px;
    min-height: auto;
    padding: 4px 0 12px;
  }

  .portrait { width: min(64vw, 218px); }
  .hero-copy h2 { font-size: 17px; }

  .actions {
    gap: 8px;
    margin-top: 20px;
  }

  .timeline { padding-left: 0; }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .timeline-period {
    position: static;
    transform: none;
    display: inline-block;
    width: auto;
    text-align: left;
    margin-bottom: 6px;
    grid-column: 1 / -1;
    background: var(--blue-mid);
    color: var(--blue-strong);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .timeline-item:hover { transform: none; }

  .timeline-panel,
  .about-contact .panel {
    min-height: auto;
    padding: 20px;
  }

  .detail-panel { display: none; }

  .timeline-item {
    grid-template-columns: 36px minmax(0, 1fr) 22px;
    min-height: 64px;
    padding: 12px 14px;
    background: #fff;
    border-color: var(--line);
  }

  .accordion-indicator {
    display: grid;
    place-items: center;
  }

  .timeline-accordion {
    display: block;
    margin: 6px 0 4px;
    padding: 18px;
    border: 1px solid var(--blue-mid);
    border-radius: 10px;
    background: var(--blue-light);
  }

  .timeline-accordion[hidden] { display: none; }
  .timeline-accordion .detail-heading { display: none; }

  .station-form,
  .skill-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Breakpoint: Small Mobile ──────────────────────────────────────────── */
@media (max-width: 560px) {
  main { padding: 14px 14px 52px; }

  h1 {
    font-size: 36px;
    letter-spacing: -1.2px;
  }

  .portrait { width: min(72vw, 198px); }

  .panel,
  .admin-shell,
  .login-card {
    border-radius: 10px;
  }

  .timeline-panel,
  .detail-panel,
  #skills,
  .about-contact .panel,
  .admin-shell {
    padding: 18px 16px;
  }

  .section-heading { margin-bottom: 16px; }

  .section-heading h2,
  .admin-intro h2,
  .login-card h2 {
    font-size: 20px;
  }

  .actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions { flex-direction: row; }

  .primary-button,
  .ghost-button {
    width: 100%;
    min-height: 48px;
  }

  .admin-item { grid-template-columns: 1fr; }

  .login-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .login-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 16px 16px 0 0;
    padding: 24px 18px 22px;
  }

  .toast {
    right: 10px;
    bottom: 70px;
    max-width: calc(100vw - 20px);
  }

  .backend-corner {
    right: 14px;
    bottom: 14px;
  }
}
