/* ---------- Reset & foundations ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--color-background);
  color: var(--color-on-surface);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
}

/* Material Symbols icon font — recommended baseline rendering rules. */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Smooth theme swaps, mirroring the Flutter app's 400ms easeInOutCubic transition. */
body,
.app-header,
.project-card,
.theme-chip,
.theme-sheet,
.contact-chip,
.skill-badge,
.project-card__launch,
.icon-button {
  transition:
    background-color 400ms cubic-bezier(0.65, 0, 0.35, 1),
    color 400ms cubic-bezier(0.65, 0, 0.35, 1),
    border-color 400ms cubic-bezier(0.65, 0, 0.35, 1),
    box-shadow 400ms cubic-bezier(0.65, 0, 0.35, 1);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.icon-button:hover {
  background: color-mix(in srgb, var(--color-on-surface) 10%, transparent);
}

/* ---------- Layout shell ---------- */
.app-main {
  padding-inline: 16px;
  padding-block-end: 16px;
}

@media (min-width: 851px) {
  .app-main {
    padding-inline: 48px;
  }
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
}

.app-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 16px;
  gap: 12px;
}

.app-header__title {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-header__inline-switcher {
  display: none;
  overflow-x: auto;
}

.header__theme-toggle {
  display: inline-flex;
}

.app-header--wide .app-header__inline-switcher {
  display: flex;
}

.app-header--wide .header__theme-toggle {
  display: none;
}

/* ---------- Theme switcher chips ---------- */
.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--color-on-surface) 30%, transparent);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.theme-chip--neo-brutalism {
  border-radius: 0;
  border-width: 2px;
}

.theme-chip:hover {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.theme-chip.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
}

.theme-chip.is-selected:hover {
  background: var(--color-primary);
}

.theme-chip__icon {
  font-size: 1.1rem;
}

/* ---------- Mobile theme sheet ---------- */
.theme-sheet-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, black 45%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.theme-sheet-overlay[hidden] {
  display: none;
}

.theme-sheet {
  width: 100%;
  max-width: 640px;
  background: var(--color-surface);
  color: var(--color-on-surface);
  border-radius: 16px 16px 0 0;
  padding: 24px;
}

.theme-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.theme-sheet__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.theme-sheet__close {
  font-size: 1rem;
  padding: 4px 8px;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 40px;
  max-width: 900px;
}

@media (min-width: 701px) {
  .hero {
    padding-block: 64px;
  }
}

@keyframes hero-fade-slide {
  from {
    opacity: 0;
    transform: translateY(12%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__name {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  animation: hero-fade-slide 800ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.hero__tagline {
  margin-top: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1.2px;
}

.hero__summary {
  margin-top: 20px;
  max-width: 640px;
  color: color-mix(in srgb, var(--color-on-surface) 72%, transparent);
  line-height: 1.7;
}

.contact-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 20px;
  align-items: center;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--color-primary);
  font-weight: 600;
}

.contact-chip:hover {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.contact-chip__icon {
  font-size: 1.1rem;
}

.hero__skills {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.skill-category__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
}

.skill-category__badges {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-category__groups {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-subgroup__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-on-surface) 60%, transparent);
}

.skill-subgroup .skill-category__badges {
  margin-top: 8px;
}

.skill-badge {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.skill-category__title--muted,
.skill-badge--muted {
  color: color-mix(in srgb, var(--color-on-surface) 78%, transparent);
}

.skill-badge--muted {
  background: color-mix(in srgb, var(--color-on-surface) 12%, transparent);
  border-color: color-mix(in srgb, var(--color-on-surface) 30%, transparent);
}

.skill-category__title--secondary,
.skill-badge--secondary {
  color: var(--color-secondary);
}

.skill-badge--secondary {
  background: color-mix(in srgb, var(--color-secondary) 12%, transparent);
  border-color: color-mix(in srgb, var(--color-secondary) 30%, transparent);
}

.skill-category__title--primary,
.skill-badge--primary {
  color: var(--color-primary);
}

.skill-badge--primary {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* ---------- Projects ---------- */
.projects {
  padding-block: 8px 16px;
}

.projects__heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.projects__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1101px) {
  .projects__grid {
    display: block;
    column-count: 2;
    column-gap: 20px;
  }

  .projects__grid .project-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
  }
}

.project-card {
  padding: 24px;
  break-inside: avoid;
  transition: transform 250ms cubic-bezier(0.33, 1, 0.68, 1), box-shadow 250ms ease, background-color 250ms ease;
}

@media (max-width: 599px) {
  .project-card {
    padding: 20px;
  }
}

.project-card:hover {
  transform: scale(1.02);
}

.project-card__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.project-card__icon {
  flex-shrink: 0;
  display: inline-flex;
  padding: 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}

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

.project-card__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.project-card__domain {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-on-surface) 65%, transparent);
}

.project-card__description {
  margin-top: 14px;
  color: color-mix(in srgb, var(--color-on-surface) 80%, transparent);
  line-height: 1.6;
}

.project-card__tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--color-tertiary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-tertiary) 30%, transparent);
  color: color-mix(in srgb, var(--color-on-surface) 80%, transparent);
}

.project-card__footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.project-card__launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
}

.project-card__launch-icon {
  font-size: 1rem;
  transition: transform 200ms ease;
}

.project-card__launch:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.project-card__launch:hover .project-card__launch-icon {
  transform: translateX(3px);
}

/* ---------- Footer ---------- */
.app-footer {
  padding: 40px 24px;
  text-align: center;
}

.app-footer__copyright {
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--color-on-surface) 45%, transparent);
}

.app-footer__contact {
  margin-top: 12px;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-on-surface) 50%, transparent);
}
