html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.site-logo {
  border-radius: 12px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}

.desktop-nav {
  display: none;
}

.desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

.desktop-nav li {
  display: flex;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.language-button {
  min-width: 42px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.language-button.active {
  background: var(--ink);
  color: #fff;
}

.header-link {
  display: none;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

.menu-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 82vw);
  height: 100%;
  padding: 24px 18px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-content {
  display: grid;
  gap: 10px;
}

.drawer-footer {
  display: grid;
  gap: 14px;
}

.drawer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 1090;
}

.drawer-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--bottom-nav-height);
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: rgba(255, 251, 245, 0.88);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.bottom-nav a,
.desktop-nav a,
.drawer-content a {
  text-decoration: none;
}

.bottom-nav a {
  border-radius: 14px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--muted);
}

.bottom-nav a.active,
.desktop-nav a.active,
.drawer-content a.active {
  color: var(--ink);
}

.bottom-nav a.active {
  background: rgba(15, 23, 42, 0.08);
}

.bottom-nav .material-icons-round,
.drawer-content .material-icons-round,
.desktop-nav .material-icons-round {
  font-size: 1.1rem;
}

#portfolioRoot {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 120px;
}

.portfolio-section,
.hero-section {
  margin-bottom: 28px;
}

.hero-section {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-aside {
  display: grid;
  gap: 18px;
}

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

.hero-section h1,
.section-heading h2,
.project-group-header h3,
.capability-card h3,
.project-card h3 {
  font-family: 'Fraunces', serif;
  line-height: 1.02;
}

.hero-section h1 {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
}

.hero-headline {
  font-size: clamp(1.1rem, 3.3vw, 1.6rem);
  font-weight: 600;
  max-width: 20ch;
}

.hero-summary {
  color: var(--muted);
  max-width: 62ch;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-action,
.project-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.hero-action:last-child {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.hero-highlight-card,
.hero-stat-card,
.capability-card,
.project-card,
.project-group {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero-highlight-card {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 10px;
}

.hero-highlight-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
}

.hero-highlight-card p,
.section-heading p,
.capability-card p,
.project-group-header p,
.project-description,
.portfolio-footer {
  color: var(--muted);
}

.hero-highlight-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stat-card {
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.hero-stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
}

.hero-stat-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.featured-grid,
.capability-grid,
.project-group-grid {
  display: grid;
  gap: 16px;
}

.project-card,
.capability-card {
  border-radius: 24px;
  padding: 18px;
}

.featured-project-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.52)),
    var(--paper);
}

.project-card-top,
.project-meta,
.project-card-footer,
.project-tag-list {
  display: flex;
  flex-wrap: wrap;
}

.project-card-top {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.project-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(211, 91, 45, 0.18), rgba(13, 148, 136, 0.18));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.project-icon .material-icons-round {
  font-size: 1.8rem;
}

.project-meta {
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-card h3 {
  font-size: 1.55rem;
  margin-bottom: 10px;
}

.project-description {
  font-size: 0.98rem;
  margin-bottom: 14px;
}

.project-tag-list {
  gap: 8px;
  margin-bottom: 18px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.project-action {
  width: 100%;
}

.project-action-muted {
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
  pointer-events: none;
}

.capability-card {
  display: grid;
  gap: 12px;
}

.capability-card h3 {
  font-size: 1.35rem;
}

.project-group-stack {
  display: grid;
  gap: 18px;
}

.project-group {
  padding: 20px;
  border-radius: 28px;
}

.project-group-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.project-group-header h3 {
  font-size: 1.8rem;
}

.portfolio-footer {
  padding: 28px 20px 8px;
  text-align: center;
  font-size: 0.92rem;
}

.portfolio-footer a {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink);
  font-weight: 600;
}

.status-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(var(--header-height) + 14px);
  z-index: 1200;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.status-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.status-toast .message {
  flex: 1;
  font-size: 0.92rem;
}

.status-toast .close {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottom-nav-height) + 16px);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  cursor: pointer;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .desktop-nav,
  .header-link {
    display: block;
  }

  .header-actions .language-switcher {
    display: inline-flex;
  }

  .menu-button,
  .bottom-nav {
    display: none;
  }

  main {
    padding-bottom: 0;
  }

  #portfolioRoot {
    padding-top: 34px;
    padding-bottom: 60px;
  }

  .desktop-nav a {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
  }

  .desktop-nav a.active {
    background: rgba(15, 23, 42, 0.08);
  }

  .hero-section {
    grid-template-columns: 1.4fr 0.9fr;
    align-items: stretch;
    padding: 34px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .back-to-top {
    bottom: 24px;
  }
}

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

  .project-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
