:root {
  --bg: #f6f7fb;
  --white: #ffffff;
  --ink: #1a1d27;
  --muted: #5c6370;
  --faint: #8a909c;
  --line: #e4e7ee;
  --accent: #2457ff;
  --accent-2: #1b46d4;
  --accent-soft: #edf1ff;
  --ok: #1f9d6c;
  --danger: #d24b3d;
  --text: var(--ink);
  --bg-2: var(--white);
  --elev: var(--white);
  --display: "Figtree", system-ui, sans-serif;
  --serif: var(--display);
  --sans: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav: 4.4rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1100px;
  --radius: 1rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131a;
  --white: #181c26;
  --ink: #eef1f6;
  --muted: #9aa3b2;
  --faint: #6e7787;
  --line: #2c3342;
  --accent: #4d7cff;
  --accent-2: #7aa2ff;
  --accent-soft: rgba(77, 124, 255, 0.16);
  --text: var(--ink);
  --bg-2: #181c26;
  --elev: #1c2230;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav);
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  transition: background 0.35s ease, color 0.35s ease;
}

body.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

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

.noscript {
  background: var(--danger);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 90;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.4rem;
  z-index: 70;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav__mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
}

.nav__links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--ink);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.nav__guest,
.nav__user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav__user span {
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__burger {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.nav__burger span {
  display: block;
  height: 2px;
  background: var(--ink);
}

.mobile-menu {
  position: fixed;
  inset: var(--nav) 0 0 0;
  background: var(--white);
  z-index: 65;
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  gap: 0.7rem;
}

.mobile-menu a,
.mobile-menu button {
  font-size: 1.15rem;
  font-weight: 700;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn--solid {
  background: var(--accent);
  color: #fff;
}

.btn--solid:hover {
  background: var(--accent-2);
}

.btn--ghost,
.btn--line {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover,
.btn--line:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav) + 1.8rem) 1.4rem 2.6rem;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-areas:
    "photo copy"
    "tiles tiles";
  gap: 1rem 1.4rem;
  align-items: stretch;
}

.hero__media {
  grid-area: photo;
  position: relative;
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 340px;
  background: #dde3f0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 340px;
}

.hero__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(18, 20, 28, 0.08);
}

.hero__copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4rem 0.2rem 0.4rem 0.4rem;
}

.hero__copy .eyebrow {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 0.85rem;
}

.hero__title span + span {
  margin-left: 0.3em;
}

.hero__lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.3rem;
  max-width: 28rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero__tiles {
  grid-area: tiles;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.hero__tiles article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}

.hero__tiles span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 0.3rem;
}

.hero__tiles strong,
.hero__tiles a {
  font-size: 1rem;
  font-weight: 750;
  color: var(--ink);
}

.hero__tiles a {
  color: var(--accent);
}

.explorer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.explorer a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 8.2rem;
  padding: 1.05rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.explorer a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.explorer strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.explorer span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.docs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 12.5rem;
  padding: 1.2rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc-card__kind {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-card h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.doc-card p {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.doc-card__meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--faint);
}

.doc-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.doc-card.is-empty {
  border-style: dashed;
}

.doc-card.is-empty .btn {
  pointer-events: none;
  opacity: 0.55;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.eyebrow,
.mono {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

main {
  min-height: calc(100vh - 7rem);
}

.section {
  padding: 4.2rem 1.4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.section--top {
  padding-top: calc(var(--nav) + 2.4rem);
}

.section__index {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.section__head {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
  margin-bottom: 2rem;
  align-items: end;
}

.display {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lede {
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2.4rem;
  align-items: center;
}

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #dde3f0;
  position: relative;
  border: 1px solid var(--line);
}

.portrait span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__caption {
  margin-top: 0.7rem;
}

.about__text {
  color: var(--muted);
  white-space: pre-line;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
}

.bento,
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.skill-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.skill-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.skill-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.veille {
  display: grid;
  gap: 1.4rem;
}

.veille-article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: 1.35rem 1.4rem 1.45rem;
}

.veille-article__head {
  margin-bottom: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.veille-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
}

.veille-article__meta time {
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 700;
}

.veille-article h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0;
}

.veille-article__summary {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.veille-article__body p {
  color: var(--ink);
  white-space: pre-line;
  line-height: 1.65;
  font-size: 0.98rem;
}

.veille-article__context,
.veille-article__points {
  margin-top: 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: 0.85rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.veille-article__points {
  background: var(--bg);
  border-color: var(--line);
}

.veille-article__context h3,
.veille-article__points h3 {
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.veille-article__context p,
.veille-article__points li {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.veille-article__points ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.35rem;
}

.veille-article__source {
  margin-top: 1.1rem;
}

.veille-article__source a {
  color: var(--accent);
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
}

.projects {
  display: grid;
  gap: 1rem;
}

.project {
  display: grid;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  appearance: none;
  color: inherit;
  padding: 0;
}

.project--featured,
.projects-grid .project {
  grid-template-columns: 1fr;
}

.project__media {
  height: 200px;
  background: #d7dce8;
  position: relative;
}

.project--featured .project__media {
  height: 260px;
}

.project__media img,
.project__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.project__placeholder {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
}

.project__body {
  padding: 1rem 1.1rem 1.15rem;
}

.project__body h3 {
  font-size: 1.2rem;
  margin: 0.2rem 0 0.35rem;
}

.project__body p {
  color: var(--muted);
  font-size: 0.92rem;
}

.project__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--faint);
}

.project__open {
  color: var(--accent);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--white);
}

.timeline {
  --rail: 1.2rem;
  list-style: none;
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.25rem 0 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: 0.4rem;
  left: calc(var(--rail) / 2);
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--line) 25%, var(--line) 75%, transparent);
  transform: translateX(-50%);
}

.tl {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 1.2rem;
  align-items: start;
  padding-bottom: 1.35rem;
  position: relative;
}

.tl:last-child {
  padding-bottom: 0;
}

.tl__marker {
  display: flex;
  justify-content: center;
  padding-top: 1.35rem;
  position: relative;
  z-index: 1;
}

.tl__dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.tl__card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: 1.05rem 1.15rem 1.15rem;
  position: relative;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.tl__card::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 1.45rem;
  width: 0.65rem;
  height: 0.65rem;
  background: var(--white);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.tl:hover .tl__card {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-2px);
}

.tl__year {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  margin-bottom: 0.7rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tl__card h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

.tl__place {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tl__text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-line;
}

@media (min-width: 900px) {
  .timeline {
    --rail: 0;
    max-width: 960px;
  }

  .timeline::before {
    left: 50%;
  }

  .tl {
    grid-template-columns: 1fr 1.4rem 1fr;
    gap: 0;
    padding-bottom: 1.8rem;
  }

  .tl__marker {
    grid-column: 2;
    padding-top: 1.5rem;
  }

  .tl__card {
    max-width: 25rem;
  }

  .tl:nth-child(odd) .tl__card {
    grid-column: 1;
    justify-self: end;
    margin-right: 1.5rem;
    text-align: right;
  }

  .tl:nth-child(odd) .tl__card::before {
    left: auto;
    right: -0.5rem;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .tl:nth-child(odd) .tl__year {
    margin-left: auto;
  }

  .tl:nth-child(even) .tl__card {
    grid-column: 3;
    justify-self: start;
    margin-left: 1.5rem;
  }
}

.contact__mail {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.contact__links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  max-width: 720px;
}

.contact__form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact__form span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.contact__form input,
.contact__form textarea {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.7rem 0.75rem;
  outline: none;
}

.contact__form input:focus,
.contact__form textarea:focus {
  border-color: var(--accent);
}

.contact__form textarea {
  resize: vertical;
  min-height: 7rem;
}

.contact__form .full,
.form-grid .full {
  grid-column: 1 / -1;
}

.form-hint {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 0.85rem;
}

.form-hint.is-ok {
  color: var(--ok);
  font-weight: 700;
}

.footer {
  padding: 1.4rem;
  max-width: var(--max);
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer__top,
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer__bottom {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--faint);
}

.footer__admin {
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  font-weight: 700;
}

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

.modal {
  width: min(860px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  border: 0;
  background: var(--white);
  color: var(--ink);
  padding: 0;
  overflow: auto;
  border-radius: 1.1rem;
}

.modal::backdrop,
.auth-modal::backdrop {
  background: rgba(20, 24, 36, 0.35);
}

.modal__inner {
  position: relative;
}

.modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 1rem;
  background: transparent;
  overflow: auto;
}

.auth-modal[open] {
  display: grid;
  place-items: center;
}

.popup {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: fit-content;
  background: var(--white);
  box-shadow:
    0px 187px 75px rgba(0, 0, 0, 0.01),
    0px 105px 63px rgba(0, 0, 0, 0.05),
    0px 47px 47px rgba(0, 0, 0, 0.09),
    0px 12px 26px rgba(0, 0, 0, 0.1);
  border-radius: 13px;
}

.popup .form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  gap: 20px;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.popup .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #ecf1fd;
  box-shadow: 0px 0.5px 0.5px #efefef, 0px 1px 0.5px rgba(239, 239, 239, 0.5);
  border-radius: 5px;
}

.popup .note {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popup .title {
  font-style: normal;
  font-weight: 700;
  font-size: 17px;
  line-height: 24px;
  color: var(--ink);
}

.popup .subtitle {
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.popup-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.popup .input_field {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 5px;
  outline: none;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
  filter: drop-shadow(0px 1px 0px #efefef) drop-shadow(0px 1px 0.5px rgba(239, 239, 239, 0.5));
  transition: all 0.3s cubic-bezier(0.15, 0.83, 0.66, 1);
  font-size: 13px;
}

.popup .input_field:focus {
  border: 1px solid transparent;
  box-shadow: 0px 0px 0px 1px var(--ink);
  background-color: transparent;
}

.popup button.submit {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  width: 100%;
  height: 42px;
  background: linear-gradient(180deg, #4480ff 0%, #115dfc 50%, #0550ed 100%);
  box-shadow: 0px 0.5px 0.5px #efefef, 0px 1px 0.5px rgba(239, 239, 239, 0.5);
  border-radius: 5px;
  border: 0;
  font-weight: 600;
  font-size: 12px;
  line-height: 15px;
  color: #ffffff;
  cursor: pointer;
}

.popup button.submit:hover {
  filter: brightness(1.05);
}

.popup .auth-error {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #d24b3d;
}

.popup .auth-switch {
  width: 100%;
  border: 0;
  background: none;
  color: #115dfc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  padding: 0;
}

.modal__media {
  height: 240px;
  background: #111;
  position: relative;
  overflow: hidden;
}

.modal__media img,
.modal__media .project__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.modal__gallery {
  margin-top: 1.1rem;
}

.modal__gallery h4 {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.modal__gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.modal__gallery-item {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  padding: 0;
  background: #d7dce8;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.modal__gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal__gallery-item.is-active,
.modal__gallery-item:hover {
  border-color: var(--accent);
}

.modal__body {
  padding: 1.4rem;
}

.modal__body h3 {
  font-size: 1.6rem;
  margin: 0.3rem 0 1rem;
}

.modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal__body h4,
.admin__error {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.admin__error {
  color: var(--danger);
}

.modal__body p {
  color: var(--muted);
  white-space: pre-line;
}

.modal__links {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.comp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.comp-list span {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 999px;
}

.cv-toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1rem;
  z-index: 85;
  border-radius: 999px;
  font-size: 0.85rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.is-in,
.tl__card.reveal {
  opacity: 1;
  transform: none;
}

.msg-card.is-read {
  opacity: 0.72;
}

@media (max-width: 980px) {
  .nav__links {
    display: none;
  }

  .nav__guest #btn-login {
    display: none;
  }

  .nav__burger {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "copy"
      "tiles";
  }

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

  .hero__media,
  .hero__media img {
    min-height: 240px;
  }

  .section__head,
  .about,
  .bento,
  .projects-grid,
  .modal__grid,
  .contact__form,
  .facts {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 560px) {
  .explorer {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

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