/* Juan P. Romano — unified site
   Clear docs-inspired layout, dark-first, blue accent */

:root {
  --font-display: "Outfit", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  --blue-600: #1a4f8b;
  --blue-500: #2b6cb0;
  --blue-400: #3d8bfd;
  --blue-300: #6babf5;
  --blue-200: #a8c8f0;

  --bg: #0e1218;
  --bg-elevated: #151b24;
  --bg-soft: #1a222e;
  --surface: #1c2533;
  --border: rgba(168, 200, 240, 0.12);
  --border-strong: rgba(168, 200, 240, 0.22);
  --text: #e8eef6;
  --text-muted: #9aa8bc;
  --text-faint: #6f7f94;
  --link: #6babf5;
  --link-hover: #a8c8f0;
  --accent: #3d8bfd;
  --banner: #1a4f8b;
  --banner-text: #ffffff;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --max: 1120px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: #eaf0f7;
  --surface: #ffffff;
  --border: rgba(26, 79, 139, 0.12);
  --border-strong: rgba(26, 79, 139, 0.22);
  --text: #152033;
  --text-muted: #4d5d73;
  --text-faint: #7a8aa0;
  --link: #1a4f8b;
  --link-hover: #123a66;
  --accent: #1a4f8b;
  --banner: #1a4f8b;
  --banner-text: #ffffff;
  --shadow: 0 12px 32px rgba(21, 40, 70, 0.08);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h);
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 139, 253, 0.08), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(26, 79, 139, 0.12), transparent 55%),
    var(--bg);
  transition: background 0.25s ease, color 0.25s ease;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}

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

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: auto;
}

.brand__mark {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand__name {
  display: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

@media (min-width: 1100px) {
  .brand__name {
    display: inline;
    margin-left: 0.35rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--border-strong);
  }
}

.site-nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-item--dropdown {
  position: relative;
}

.nav-chevron {
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 180px;
  padding: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.nav-item--dropdown.is-open .nav-menu {
  display: grid;
}

.nav-menu__link {
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}

.nav-menu__link:hover {
  background: var(--bg-soft);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 980px) {
  .nav-toggle {
    display: none;
  }
  .site-nav {
    display: flex;
  }
}

body.nav-open .site-nav {
  display: flex;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 0.75rem 1rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

body.nav-open .nav-item--dropdown .nav-menu {
  position: static;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding-left: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn--primary:hover {
  background: var(--blue-500);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

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

.btn--soft {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--link);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.theme-toggle svg {
  display: block;
}

[data-theme="dark"] .theme-toggle__moon,
[data-theme="light"] .theme-toggle__sun {
  display: none;
}

/* Hero / banners */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(135deg, #163a66 0%, var(--banner) 45%, #0f2f55 100%);
  color: var(--banner-text);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.28;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  display: grid;
  gap: 1.25rem;
  max-width: 44rem;
}

.hero__kicker {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: 600;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 38rem;
  opacity: 0.92;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hero .btn--primary {
  background: #fff;
  color: var(--blue-600);
}

.hero .btn--primary:hover {
  background: #e8f1ff;
  color: var(--blue-600);
}

.hero .btn--ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.page-banner {
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.1), transparent 40%),
    linear-gradient(135deg, #163a66, var(--banner));
  color: var(--banner-text);
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.25;
}

.page-banner__inner {
  position: relative;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: clamp(2.4rem, 5vw, 3.4rem) 0;
}

.page-banner__eyebrow {
  margin: 0 0 0.5rem;
  opacity: 0.8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.page-banner__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-banner__subtitle {
  margin: 0.75rem 0 0;
  max-width: 40rem;
  opacity: 0.92;
  font-size: 1.05rem;
}

/* Layout */
#main {
  flex: 1 0 auto;
  width: min(100% - 2rem, var(--max));
  max-width: 100%;
  margin-inline: auto;
  min-width: 0;
}

.layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  display: grid;
  gap: 2.5rem;
}

.layout > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 960px) {
  .layout--with-sidebar {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }
}

.section {
  margin-bottom: 2.75rem;
  min-width: 0;
  max-width: 100%;
}

.section:last-child {
  margin-bottom: 0;
}

.section-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.section-heading-row .section-heading {
  margin-bottom: 0.35rem;
}

.section-heading-row .section-lead {
  margin: 0;
}

.project-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.project-carousel__viewport {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.project-carousel__track {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  transition: transform 0.45s var(--ease);
  will-change: transform;
}

.project-carousel__card {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.project-carousel__card .catalog-item__media {
  aspect-ratio: 16 / 10;
}

.project-carousel__card .catalog-item__body {
  padding: 0.7rem 0.8rem 0.85rem;
  gap: 0.35rem;
}

.project-carousel__card .catalog-item__title {
  font-size: 0.92rem;
  line-height: 1.25;
}

.project-carousel__card .catalog-item__meta {
  font-size: 0.68rem;
}

@media (max-width: 719px) {
  .project-carousel__card .catalog-item__media {
    aspect-ratio: 2 / 1;
  }

  .project-carousel__card .catalog-item__body {
    padding: 0.55rem 0.7rem 0.7rem;
  }

  .project-carousel__card .catalog-item__title {
    font-size: 0.88rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (min-width: 720px) {
  .project-carousel__track {
    gap: 1rem;
  }

  .project-carousel__card {
    flex: 0 0 calc((100% - 2rem) / 3);
    width: calc((100% - 2rem) / 3);
    max-width: calc((100% - 2rem) / 3);
  }

  .project-carousel__card .catalog-item__title {
    font-size: 1rem;
  }

  .project-carousel__card .catalog-item__body {
    padding: 0.95rem 1rem 1.1rem;
  }
}

.project-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.project-carousel__btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.project-carousel__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  align-items: center;
  max-width: 14rem;
}

.project-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: width 0.2s ease, background 0.15s ease;
}

.project-carousel__dot.is-active {
  width: 22px;
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .project-carousel__track {
    transition: none;
  }
}

.section:last-child {
  margin-bottom: 0;
}

.section-heading {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.section-heading::before {
  content: "/";
  color: var(--accent);
  font-weight: 700;
}

.section-lead {
  margin: -0.25rem 0 1.5rem;
  color: var(--text-muted);
  max-width: 42rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  font-weight: 500;
}

.signal-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.signal-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.signal-list__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}

.signal-list__value {
  color: var(--text);
  font-weight: 500;
}

.lang-flags {
  display: inline;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

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

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

.skill-block h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.skill-block h3::before {
  content: "// ";
  color: var(--accent);
}

.skill-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-list li {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.contact-list {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.contact-row:hover {
  border-color: var(--border-strong);
  color: inherit;
}

.contact-row__meta {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-row__value {
  font-weight: 500;
}

.social-row {
  display: flex;
  gap: 0.65rem;
}

.social-row a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.social-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.sidebar h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.sidebar h2::before {
  content: "/// ";
  color: var(--blue-300);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  color: var(--text);
  background: var(--bg-soft);
}

.sidebar-cta {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

/* Catalog / filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.catalog-count {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.catalog-count strong {
  color: var(--text);
  font-weight: 700;
}

.search-input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 360px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.search-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: var(--accent);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.filter-btn.is-active,
.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.catalog-grid--list {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.catalog-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.catalog-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.catalog-item--horizontal {
  flex-direction: column;
}

@media (min-width: 720px) {
  .catalog-item--horizontal {
    flex-direction: row;
    align-items: stretch;
  }

  .catalog-item--horizontal .catalog-item__media {
    flex: 0 0 240px;
    max-width: 280px;
    aspect-ratio: auto;
    min-height: 100%;
  }

  .catalog-item--horizontal .catalog-item__body {
    flex: 1;
    padding: 1.25rem 1.35rem;
  }

  .catalog-item--horizontal .catalog-item__title {
    font-size: 1.25rem;
  }
}

.catalog-item__media {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

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

@media (min-width: 980px) {
  .catalog-item__media--zoomable {
    cursor: zoom-in;
  }
}

.catalog-item__media--logo {
  display: grid;
  place-items: center;
  background: #f4f4f4;
  border-bottom: 1px solid var(--border);
}

.catalog-item__media--logo img {
  width: 38%;
  height: auto;
  max-height: 46%;
  object-fit: contain;
  border-radius: 6px;
}

.medium-latest__logo {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: #f4f4f4;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.medium-latest__logo img {
  width: 48%;
  height: auto;
  border-radius: 5px;
}

.medium-latest {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.medium-latest:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.medium-latest__meta {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.medium-latest__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
}

.medium-latest__cta {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 560px) {
  .medium-latest {
    grid-template-columns: 64px 1fr;
    gap: 0.85rem;
    padding: 0.85rem;
  }

  .medium-latest__logo {
    width: 64px;
    height: 64px;
  }

  .medium-latest__title {
    font-size: 1.05rem;
  }
}

.catalog-item__body {
  padding: 0.95rem 1rem 1.1rem;
  display: grid;
  gap: 0.55rem;
  flex: 1;
}

.catalog-item__meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
}

.catalog-item__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
}

.catalog-item__brief {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.catalog-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.catalog-item__actions a,
.catalog-item__actions span {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.catalog-item__actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catalog-item__actions .is-disabled {
  opacity: 0.55;
  cursor: default;
}

.catalog-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}

/* Resume cards */
.resume-grid {
  display: grid;
  gap: 1rem;
}

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

.resume-card {
  padding: 1.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 0.75rem;
}

.resume-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.resume-card p {
  margin: 0;
  color: var(--text-muted);
}

.resume-card__status {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: auto;
}

.site-footer__inner {
  padding: 2rem 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .site-footer__inner {
    grid-template-columns: 1.4fr 1fr auto;
    align-items: end;
  }
}

.site-footer__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.site-footer__tag {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.site-footer__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
}

.site-footer__links a:hover {
  color: var(--accent);
}

.site-footer__copy {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.88rem;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s var(--ease), visibility 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 960px) {
  .back-to-top {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
  .hero__title,
  .page-banner__title {
    animation: rise 0.7s var(--ease) both;
  }
  .hero__subtitle,
  .page-banner__subtitle {
    animation: rise 0.7s var(--ease) 0.08s both;
  }
  .hero__actions {
    animation: rise 0.7s var(--ease) 0.14s both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* Portfolio lightbox — desktop */
.project-lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(960px, calc(100vw - 3rem));
  width: 100%;
  color: inherit;
}

.project-lightbox::backdrop {
  background: rgba(8, 12, 18, 0.72);
  backdrop-filter: blur(6px);
}

.project-lightbox__panel {
  position: relative;
  display: grid;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.project-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.project-lightbox__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-lightbox__media {
  background: var(--bg-soft);
  max-height: min(70vh, 640px);
  display: grid;
  place-items: center;
}

.project-lightbox__media img {
  width: 100%;
  height: auto;
  max-height: min(70vh, 640px);
  object-fit: contain;
  display: block;
}

.project-lightbox__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.project-lightbox__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  line-height: 1.3;
}

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

.project-lightbox__actions .btn[hidden] {
  display: none !important;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 979px) {
  .project-lightbox {
    display: none !important;
  }
}
