/* --------------------------------------- */
/* Tokens & themes
/* --------------------------------------- */

:root,
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --text: #e8eef8;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --sidebar-width: 34rem;
  --content-max: 72rem;
  --radius: 1.2rem;
  --font-display: "Outfit", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.7rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* --------------------------------------- */
/* Focus
/* --------------------------------------- */

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

body:not(.user-is-tabbing) a:focus,
body:not(.user-is-tabbing) button:focus {
  outline: none;
}

/* --------------------------------------- */
/* Layout
/* --------------------------------------- */

.layout {
  width: min(120rem, calc(100% - 4rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 4rem;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 6rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
}

.main {
  padding: 6rem 0 8rem;
  max-width: var(--content-max);
}

/* --------------------------------------- */
/* Sidebar
/* --------------------------------------- */

.sidebar__eyebrow {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.sidebar__name {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 3.6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.sidebar__title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.4rem;
}

.sidebar__blurb {
  color: var(--muted);
  max-width: 30rem;
  margin-bottom: 3.5rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  width: fit-content;
  padding: 0.8rem 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.sidebar__link::before {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.sidebar__link:hover,
.sidebar__link.is-active {
  color: var(--accent);
}

.sidebar__link.is-active::before {
  width: 4.8rem;
  background: var(--accent);
}

.sidebar__bottom {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.sidebar__socials {
  display: flex;
  gap: 1rem;
}

.sidebar__socials a {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.sidebar__socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sidebar__socials svg {
  width: 1.8rem;
  height: 1.8rem;
}

.theme-toggle {
  position: relative;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle__icon {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.8rem;
  height: 1.8rem;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.7);
}

.theme-toggle__icon--moon {
  opacity: 1;
}

[data-theme="light"] .theme-toggle__icon--sun {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle__icon--moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.7);
}

/* --------------------------------------- */
/* Sections
/* --------------------------------------- */

.section {
  margin-bottom: 8rem;
  scroll-margin-top: 3rem;
}

.section__heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.4rem;
}

/* --------------------------------------- */
/* About
/* --------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 3rem;
  align-items: start;
}

.about__copy p {
  color: var(--muted);
  margin-bottom: 1.6rem;
  max-width: 58rem;
}

.about__copy p:last-of-type {
  margin-bottom: 2.4rem;
}

.about__photo {
  width: 18rem;
  height: 18rem;
  border-radius: 1.6rem;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* --------------------------------------- */
/* Experience
/* --------------------------------------- */

.experience {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.experience__item {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 2.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.experience__item:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.experience__dates {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.4rem;
}

.experience__role {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.experience__company {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.4rem;
}

.experience__location {
  color: var(--muted);
  font-weight: 500;
}

.experience__bullets {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.experience__bullets li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
}

.experience__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.tags li {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.45rem 1rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.experience__earlier {
  margin-top: 2.4rem;
  color: var(--muted);
  font-size: 1.5rem;
}

/* --------------------------------------- */
/* Skills
/* --------------------------------------- */

.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}

.skills__group {
  padding: 1.8rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.skills__group h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

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

/* --------------------------------------- */
/* Writing
/* --------------------------------------- */

.writing {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.writing__item {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  gap: 1.6rem;
  align-items: start;
  padding: 1.8rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.writing__item:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.writing__date {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.35rem;
}

.writing__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.writing__item:hover .writing__title {
  color: var(--accent);
}

.writing__excerpt {
  display: block;
  color: var(--muted);
  font-size: 1.55rem;
}

.writing__arrow {
  color: var(--muted);
  font-size: 1.6rem;
  padding-top: 0.3rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.writing__item:hover .writing__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.writing__more {
  margin-top: 2rem;
}

/* --------------------------------------- */
/* Contact & footer
/* --------------------------------------- */

.contact p {
  color: var(--muted);
  max-width: 54rem;
  margin-bottom: 2.4rem;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.6rem;
  padding: 0 2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #042f2e;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(45, 212, 191, 0.25);
}

[data-theme="light"] .btn {
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

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

.footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.4rem;
}

/* --------------------------------------- */
/* Motion
/* --------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-inview {
  opacity: 1;
  transform: none;
}

.sidebar__name,
.sidebar__title,
.sidebar__blurb {
  animation: fade-up 0.7s ease both;
}

.sidebar__title {
  animation-delay: 0.08s;
}

.sidebar__blurb {
  animation-delay: 0.14s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------- */
/* Responsive
/* --------------------------------------- */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    width: min(100%, calc(100% - 3.2rem));
    gap: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 3.2rem 0 2rem;
    gap: 2.4rem;
  }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem 1.6rem;
  }

  .sidebar__link::before {
    display: none;
  }

  .sidebar__blurb {
    max-width: 48rem;
    margin-bottom: 2rem;
  }

  .main {
    padding: 1rem 0 5rem;
  }

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

  .about__photo {
    order: -1;
    width: 14rem;
    height: 14rem;
  }

  .experience__item {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 1.8rem;
  }

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

  .writing__item {
    grid-template-columns: 1fr auto;
    gap: 1rem;
  }

  .writing__date {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  html {
    font-size: 56%;
  }

  .layout {
    width: calc(100% - 2.4rem);
  }

  .sidebar__name {
    font-size: 3.2rem;
  }

  .contact__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
