@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("fonts/InterDisplay-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1b1b20;
  --surface: #232329;
  --surface-2: #2d2d34;
  --line: #36363e;
  --text: #ededf0;
  --muted: #a3a3ad;
  --radius: 18px;
  --max: 1080px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f0f0f2;
    --line: #e2e2e6;
    --text: #141417;
    --muted: #5d5d66;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f0f0f2;
  --line: #e2e2e6;
  --text: #141417;
  --muted: #5d5d66;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 1rem; }

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

h1, h2, h3 {
  font-family: "Inter Display", "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0;
}
h1, h2 { letter-spacing: -0.035em; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.brand {
  font-family: "Inter Display", "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
}
.brand-mark { width: 28px; height: 28px; }
.header-end { display: flex; align-items: center; gap: 0.25rem; }
.nav { display: flex; gap: 0.25rem; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 0.8rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle[aria-pressed="true"] .sun,
.theme-toggle[aria-pressed="false"] .moon { display: none; }

.hero { padding: clamp(4rem, 11vw, 7rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  line-height: 1.02;
  margin-bottom: 1.25rem;
  max-width: 13ch;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 2rem;
}
.hero-shots { position: relative; height: 470px; }
.hero-shots img {
  position: absolute;
  width: 210px;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.45);
}
.hero-shots img:first-child { right: 0; top: 0; transform: rotate(4deg); }
.hero-shots img:last-child { right: 150px; top: 40px; transform: rotate(-3deg); }
.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 46ch;
  margin: 0;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
}
.button { transition: background 0.2s, opacity 0.2s; }
.button:hover { background: var(--surface-2); }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.primary:hover { opacity: 0.88; }

section { padding: clamp(3rem, 7vw, 5rem) 0; }
section.flush-top { padding-top: 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.section-head p { color: var(--muted); margin: 0.7rem 0 0; max-width: 58ch; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card { transition: border-color 0.2s, transform 0.2s; }
.card:has(a:hover) { border-color: var(--muted); transform: translateY(-2px); }
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  margin-bottom: 0.6rem;
}
.card-icon.placeholder {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
}
.card-icon.placeholder svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.35rem; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card p { margin: 0; color: var(--muted); }
.card .more { margin-top: auto; padding-top: 0.6rem; font-weight: 600; color: var(--text); }

.status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 2rem;
}
.about p { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.about strong { display: block; margin-bottom: 0.35rem; font-size: 1.05rem; }
.about p { margin: 0; color: var(--muted); }
.about strong { color: var(--text); font-weight: 600; }

.app-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.app-hero .app-icon { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 0.5rem; }
.app-hero h1 { margin-bottom: 0; }
.app-hero .lead { margin-top: 0.4rem; }

.phones {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0 1.25rem;
  scrollbar-width: thin;
}
.phones figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.phones img {
  width: clamp(200px, 24vw, 250px);
  border-radius: 24px;
  border: 1px solid var(--line);
}
.phones figcaption { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}
.feature {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.feature h3 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.feature ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.97rem; }
.feature li + li { margin-top: 0.3rem; }

.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.97rem;
}
.specs dt { font-weight: 600; }
.specs dd { margin: 0; color: var(--muted); }


.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 820px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-shots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .button { transition: none; }
  .card:has(a:hover) { transform: none; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
}

@media (max-width: 560px) {
  .nav a { padding-inline: 0.6rem; }
  .card { padding: 1.3rem; }
}

.hero > .status:first-child { margin-bottom: 0.75rem; }

.themes { display: grid; gap: 1.5rem; }
.segmented {
  justify-self: start;
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segmented[hidden] { display: none; }
.segmented [role="tab"] {
  min-height: 40px;
  min-width: 88px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.segmented [role="tab"][aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(45%, 150px), 1fr));
  gap: 1.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 900px) {
  .theme-grid { grid-template-columns: repeat(5, 1fr); gap: 2rem 1.5rem; }
}
.theme-grid figure { margin: 0; }
.theme-grid img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
}
.theme-grid figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
  }
  @keyframes fade-in {
    from { opacity: 0; }
  }
  @keyframes shot-left {
    from { opacity: 0; transform: translateY(40px) rotate(0deg); }
  }
  @keyframes shot-right {
    from { opacity: 0; transform: translateY(60px) rotate(0deg); }
  }
  @keyframes slide-up {
    from { transform: translateY(36px); }
  }
  @keyframes spin-in {
    from { transform: rotate(-90deg) scale(0.6); opacity: 0; }
  }

  .hero h1,
  .hero .status,
  .hero .lead,
  .hero .actions,
  .app-hero .app-icon {
    animation: fade-up 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero .status { animation-delay: 0.05s; }
  .hero .lead { animation-delay: 0.1s; }
  .hero .actions { animation-delay: 0.18s; }
  .hero-shots img:first-child { animation: shot-right 0.9s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-shots img:last-child { animation: shot-left 0.9s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  .theme-panel:not([hidden]) { animation: fade-in 0.35s ease both; }
  .theme-toggle svg { animation: spin-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }

  @supports (animation-timeline: view()) {
    .section-head,
    .projects > li,
    .about p,
    .feature,
    .theme-grid li,
    .phones,
    .specs {
      animation: slide-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

section[id] { scroll-margin-top: 64px; }
