﻿:root {
  --bg: #f2f4f7;
  --bg-alt: #e8ecf1;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  --accent: #0f4c5c;
  --accent-strong: #0a3440;
  --success: #0e9f6e;
  --danger: #c2410c;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 6px 16px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #121b2c;
  --surface: #172135;
  --surface-muted: #1e2a42;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #334155;
  --accent: #56a3b8;
  --accent-strong: #2c7c92;
  --success: #34d399;
  --danger: #f97316;
  --shadow-soft: 0 10px 28px rgba(2, 6, 23, 0.5);
  --shadow-card: 0 6px 16px rgba(2, 6, 23, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #eef2f6 0%, #f7f9fb 100%);
  color: var(--text);
  scroll-behavior: smooth;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
  background: linear-gradient(180deg, #0b1220 0%, #10192a 100%);
}

body {
  line-height: 1.6;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -48px;
  z-index: 100;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4.75rem 0;
}

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

.section-inner.two-columns {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 920px) {
  .section-inner.two-columns {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

[data-theme="dark"] .topbar {
  background: rgba(11, 18, 32, 0.88);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.logo-text {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar.menu-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.menu-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.topbar.menu-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
}

.theme-switcher label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.theme-switcher select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  font-size: 0.84rem;
}

.hero {
  padding: 5.25rem 0 4.25rem;
}

.hero-inner {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 980px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: center;
  }
}

.hero-eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0 0 1.6rem;
  max-width: 38rem;
  color: #334155;
  font-size: 1rem;
}

[data-theme="dark"] .hero-subtitle {
  color: #cbd5e1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 76, 92, 0.24);
}

.btn.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn.outline {
  border-color: #94a3b8;
  color: var(--accent-strong);
  background: #ffffff;
}

[data-theme="dark"] .btn.outline {
  border-color: var(--line);
  color: var(--text);
  background: #1e293b;
}

.btn.outline:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.hero-details {
  display: grid;
  gap: 0.2rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.hero-card {
  max-width: 360px;
  margin-left: auto;
}

.hero-card-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.45rem;
  box-shadow: var(--shadow-soft);
}

.hero-card-title {
  margin: 0 0 0.55rem;
  font-weight: 700;
}

.hero-card-text {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.hero-card-list li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.35rem;
}

.hero-card-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

h2 {
  margin: 0 0 0.65rem;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  margin: 0 0 1.6rem;
  color: var(--muted);
  max-width: 40rem;
  font-size: 0.97rem;
}

.info-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.info-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
}

.info-item .label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 700;
}

.info-item .value {
  font-size: 0.93rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
}

.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card ul li {
  margin-bottom: 0.35rem;
}

.skills-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 860px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 859px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.timeline {
  position: relative;
  margin-top: 1.25rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #93a5b1;
}

.timeline-item {
  position: relative;
  padding-left: 2.55rem;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: 3px;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
}

.timeline-content h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.timeline-meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.projects-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 980px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-meta,
.project-tags {
  color: var(--muted);
  font-size: 0.85rem;
}

.project-link {
  margin-top: 0.8rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.project-link.disabled {
  opacity: 0.72;
}

.auth-section {
  background: #dde4eb;
}

[data-theme="dark"] .auth-section {
  background: #111a2b;
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.auth-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.auth-tab:hover,
.auth-tab:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.auth-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.auth-status {
  margin: 0 0 1rem;
  min-height: 1.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-status.success {
  color: var(--success);
}

.auth-status.error {
  color: var(--danger);
}

.auth-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 520px;
}

.auth-card {
  min-height: 100%;
}

.auth-card h3 {
  margin-bottom: 0.8rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-form label {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 600;
}

[data-theme="dark"] .auth-form label {
  color: #cbd5e1;
}

.auth-form input {
  border: 1px solid #b7c4d3;
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  padding: 0.62rem 0.7rem;
}

[data-theme="dark"] .auth-form input {
  border-color: #475569;
  background: #0f172a;
  color: var(--text);
}

.auth-form input::placeholder {
  color: #94a3b8;
}

.auth-form button {
  margin-top: 0.45rem;
  width: 100%;
}

.user-card {
  display: none;
}

.user-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.user-email,
.user-note {
  color: var(--muted);
}

.user-email {
  margin: 0.32rem 0 0;
}

.user-note {
  margin: 0.7rem 0 0.95rem;
  font-size: 0.9rem;
}

.auth-section.is-authenticated .guest-only {
  display: none;
}

.auth-section.is-authenticated .auth-only {
  display: block;
}

.auth-section.is-guest .guest-only {
  display: block;
}

.auth-section.is-guest .auth-only {
  display: none;
}

.auth-panel[hidden] {
  display: none !important;
}

.contact-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.35rem;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  text-decoration: underline;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  color: var(--muted);
  box-shadow: var(--shadow-card);
}

.contact-title {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-weight: 700;
}

.contact-footnote {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.footer {
  border-top: 1px solid var(--line);
  background: #e2e8f0;
  padding: 1.8rem 0 2.1rem;
}

[data-theme="dark"] .footer {
  background: #111a2b;
}

.footer-inner {
  text-align: center;
  font-size: 0.86rem;
  color: #334155;
}

[data-theme="dark"] .footer-inner {
  color: #94a3b8;
}

@media (max-width: 760px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "logo toggle"
      "nav nav"
      "theme theme";
    align-items: center;
    column-gap: 0.8rem;
    row-gap: 0.7rem;
  }

  .logo {
    grid-area: logo;
  }

  .menu-toggle {
    grid-area: toggle;
    display: inline-flex;
    justify-self: end;
  }

  .nav {
    grid-area: nav;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: var(--shadow-card);
  }

  .topbar.menu-open .nav {
    display: flex;
  }

  .nav a {
    width: 100%;
    border-bottom: 1px solid var(--line);
    padding: 0.45rem 0;
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .theme-switcher {
    grid-area: theme;
    margin-left: 0;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-card {
    max-width: 100%;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .contact-card,
  .hero-card-inner {
    padding: 1.1rem 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
