/* ── RESET & BASE ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-bg: #fdfcf9;
  --c-surface: #f5f2ec;
  --c-border: #dedad2;
  --c-text: #111111;
  --c-muted: #555555;
  --c-accent: #3d5a96;
  --c-accent-h: #2f4878;
  --c-badge: #e8edf8;
  --c-badge-t: #2f4878;
  --c-nav-bg: rgba(253, 252, 249, 0.92);

  --ff-serif: "Playfair Display", Georgia, serif;
  --ff-sans: "Inter", system-ui, sans-serif;
}

[data-page="classic"] {
  --ff-serif: "Finlandica Headline", Georgia, serif;
  --ff-sans: "Finlandica Text", system-ui, sans-serif;
}

[data-page="classic"] .nav__logo,
[data-page="classic"] .hero__name {
  font-weight: 700;
}

[data-page="classic"] {
  --size-xs: 0.75rem;
  --size-sm: 0.875rem;
  --size-base: 1rem;
  --size-lg: 1.125rem;
  --size-xl: 1.5rem;
  --size-2xl: 2rem;
  --size-3xl: 2.75rem;
  --size-4xl: 3.75rem;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  --nav-h: 68px;
  --max-w: 1100px;
}

[data-theme="dark"] {
  --c-bg: #0d1117;
  --c-surface: #161b22;
  --c-border: #30363d;
  --c-text: #e6edf3;
  --c-muted: #8b949e;
  --c-accent: #3fb950;
  --c-accent-h: #2ea043;
  --c-badge: #1b2b22;
  --c-badge-t: #56d364;
  --c-nav-bg: rgba(13, 17, 23, 0.92);
}

[data-page="classic"][data-theme="dark"] {
  --c-accent: #6b9adb;
  --c-accent-h: #5585c8;
  --c-badge: #1a2540;
  --c-badge-t: #9dbff0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff-sans);
  font-size: var(--size-base);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container {
  width: min(var(--max-w), 100% - 3rem);
  margin-inline: auto;
}

.section {
  padding-block: 6rem;
}

.section__label {
  font-family: var(--ff-sans);
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
  max-width: 200px;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1.4em;
  border-radius: var(--radius);
  font-family: var(--ff-sans);
  font-size: var(--size-sm);
  font-weight: 600;
  background: var(--c-accent);
  color: #fff;
  border: 2px solid var(--c-accent);
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.15s;
  text-decoration: none;
}
.btn:hover {
  background: var(--c-accent-h);
  border-color: var(--c-accent-h);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--c-accent);
}
.btn--ghost:hover {
  background: var(--c-accent);
  color: #fff;
}
.nav .btn--sm {
  background: transparent;
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.nav .btn--sm:hover {
  background: var(--c-accent);
  color: #fff;
}
.btn--sm {
  font-size: var(--size-xs);
  padding: 0.45em 1em;
}
.btn--lg {
  font-size: var(--size-lg);
  padding: 0.8em 2em;
}

/* ── NAVIGATION ──────────────────────────────────────────────── */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

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

.nav__logo {
  font-family: var(--ff-serif);
  font-size: var(--size-xl);
  font-weight: 900;
  color: var(--c-text);
  letter-spacing: -0.02em;
}
.nav__logo:hover {
  text-decoration: none;
  color: var(--c-accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__links a {
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--c-muted);
  transition: color 0.18s;
}
.nav__links a:hover {
  color: var(--c-text);
  text-decoration: none;
}

.nav__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 56px;
  height: 28px;
  padding: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.theme-switch:hover {
  border-color: var(--c-muted);
}

.theme-switch__thumb {
  position: absolute;
  top: 50%;
  left: 2.5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-muted);
  transition: transform 0.2s;
  transform: translateY(-50%) translateX(0);
}
[data-theme="dark"] .theme-switch__thumb {
  transform: translateY(-50%) translateX(27px);
}
[data-theme="light"] .theme-switch__thumb {
  transform: translateY(-50%) translateX(0);
}

.theme-switch__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

[data-theme="light"] .theme-switch__slot:first-child {
  color: var(--c-bg);
}
[data-theme="light"] .theme-switch__slot:last-of-type {
  color: var(--c-muted);
}
[data-theme="dark"] .theme-switch__slot:first-child {
  color: var(--c-muted);
}
[data-theme="dark"] .theme-switch__slot:last-of-type {
  color: var(--c-bg);
}

.theme-switch .icon-sun,
.theme-switch .icon-moon {
  display: block;
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition:
    transform 0.25s,
    opacity 0.25s;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  padding-block: 7rem 5rem;
  max-width: 780px;
}

.hero__kicker {
  font-size: var(--size-sm);
  font-weight: 200;
  color: var(--c-muted);
}

.hero__name {
  font-family: var(--ff-serif);
  font-size: clamp(var(--size-3xl), 7vw, var(--size-4xl));
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--c-text);
}

.hero__pronounce {
  font-size: var(--size-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--c-muted);
  vertical-align: middle;
  font-family: var(--ff-sans);
}

.hero__role {
  font-size: var(--size-md);
  font-weight: 400;
  color: var(--c-muted);
  margin-bottom: 1.5rem;
}

.hero__bio {
  font-size: var(--size-lg);
  max-width: 580px;
  color: var(--c-muted);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero__socials {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hero__socials a {
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--c-muted);
  border-bottom: 1px solid transparent;
  transition:
    color 0.18s,
    border-color 0.18s;
}
.hero__socials a:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
  text-decoration: none;
}

/* ── ABOUT ───────────────────────────────────────────────────── */
.about {
  background: var(--c-surface);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: start;
}

.about__text h2 {
  font-family: var(--ff-serif);
  font-size: var(--size-2xl);
  font-weight: 700;
  margin-bottom: 1rem;
}
.about__text p + p {
  margin-top: 1rem;
}
.about__text p {
  color: var(--c-muted);
  line-height: 1.8;
}

.about__photo-wrap {
  flex-shrink: 0;
}

.about__photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  display: block;
}

.about__photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  background: var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--size-sm);
  color: var(--c-muted);
  font-weight: 500;
  line-height: 1.4;
  /* swap this out: <img src="your-photo.jpg" /> */
}

/* ── EXPERIENCE ──────────────────────────────────────────────── */
.exp__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.exp__timeline h2,
.exp__skills h2 {
  font-family: var(--ff-serif);
  font-size: var(--size-2xl);
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 2.5rem;
  border-left: 2px solid var(--c-border);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
}
.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item__date {
  display: block;
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  margin-bottom: 0.4rem;
}
.timeline-item__title {
  font-size: var(--size-base);
  font-weight: 600;
  color: var(--c-text);
}
.timeline-item__company {
  font-size: var(--size-sm);
  color: var(--c-muted);
  margin-bottom: 0.6rem;
}
.timeline-item__desc {
  font-size: var(--size-sm);
  color: var(--c-muted);
  margin-bottom: 0.75rem;
}

/* Skills */
.skills-group {
  margin-bottom: 1.75rem;
}
.skills-group h4 {
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 0.6rem;
}

.edu {
  font-size: var(--size-sm);
  color: var(--c-muted);
  line-height: 1.7;
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-list li {
  font-size: var(--size-xs);
  font-weight: 500;
  padding: 0.25em 0.7em;
  border-radius: 99px;
  background: var(--c-badge);
  color: var(--c-badge-t);
}
.tag-list--large li {
  font-size: var(--size-sm);
  padding: 0.35em 0.9em;
}

/* ── PROJECTS ────────────────────────────────────────────────── */
.projects {
  background: var(--c-surface);
}

.projects h2 {
  font-family: var(--ff-serif);
  font-size: var(--size-2xl);
  font-weight: 700;
  margin-bottom: 0;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  height: 100%;
}

.project-card--with-preview {
  padding: 0;
  overflow: hidden;
}

.project-card__preview {
  height: 155px;
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}

.project-card__preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top;

  opacity: 0.72;

  transition:
    opacity 0.2s,
    transform 0.3s ease;
}

.project-card--with-preview:hover .project-card__preview img {
  opacity: 1;
  transform: scale(1.015);
}

.project-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem 1.1rem;
  min-width: 0;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-card--featured {
  border-color: var(--c-accent);
  border-width: 1.5px;
}

.project-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-card__title {
  min-width: 0;
}

.project-card__links {
  flex-shrink: 0;
}

.project-card__links a {
  white-space: nowrap;
}
.project-card__links a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.project-card__links a:hover {
  color: var(--c-accent);
  text-decoration: none;
}

.project-card__desc {
  font-size: var(--size-sm);
  color: var(--c-muted);
  line-height: 1.75;
  flex: 1;
}

.project-card--github {
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--c-accent);
  border-style: dashed;
}

.project-card--github:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  text-decoration: none;
}

.project-card__github-label {
  font-size: var(--size-sm);
  font-weight: 600;
  text-align: center;
}

.projects__grid:not(.is-expanded) .project-card--extra {
  display: none;
}

.projects__toggle {
  display: block;
  margin: 1.5rem auto 0;
}

.projects__toggle:focus:not(:hover) {
  background: transparent;
}

.projects__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

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

@media (max-width: 600px) {
  .project-card__preview {
    height: 125px;
  }

  .project-card__header {
    display: block;
    margin-bottom: 0.75rem;
  }

  .project-card__links {
    margin-top: 0.25rem;
  }

  .project-card__links a {
    white-space: nowrap;
  }

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

/* ── CONTACT ─────────────────────────────────────────────────── */
.contact__inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}
.contact__inner h2 {
  font-family: var(--ff-serif);
  font-size: var(--size-3xl);
  font-weight: 700;
  margin-bottom: 1rem;
}
.contact__inner p {
  color: var(--c-muted);
  margin-bottom: 2rem;
  font-size: var(--size-lg);
  line-height: 1.7;
}
.contact__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.contact__links a {
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--c-muted);
  transition: color 0.18s;
}
.contact__links a:hover {
  color: var(--c-accent);
  text-decoration: none;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--c-border);
  font-size: var(--size-sm);
  color: var(--c-muted);
  text-align: center;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
  .about__photo-wrap {
    order: -1;
  }
  .about__photo-placeholder {
    width: 140px;
    height: 140px;
  }
  .about__photo {
    width: 140px;
    height: 140px;
  }
  .exp__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .nav__links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    padding: 1.5rem 1.5rem;
  }
  .nav__links.is-open {
    display: flex;
  }
  .nav__end .nav__burger {
    display: flex;
  }
  .nav {
    position: relative;
  }
  .section {
    padding-block: 4rem;
  }
  .hero {
    padding-block: 4rem 3rem;
  }
}

/* ── FADE-IN ANIMATION ───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}
.fade-up.is-visible {
  opacity: 1;
  transform: none;
}
