:root {
  color-scheme: light;
  --paper: light-dark(#f7f8f3, #121813);
  --ink: light-dark(#1c251f, #edf3eb);
  --muted: light-dark(#4d5750, #b8c5ba);
  --rule: light-dark(#d9dfd7, #354239);
  --green: light-dark(#41644b, #a2caaa);
  --card: light-dark(#fff, #1b241d);
  --wrap: 72rem;
  --gutter: clamp(1.2rem, 4.5vw, 3.5rem);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; }
}
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 5;
  inset: .7rem auto auto .7rem;
  padding: .8rem 1rem;
  border-radius: .5rem;
  color: var(--paper);
  background: var(--ink);
  clip-path: inset(50%);
}
.skip-link:focus { clip-path: none; }

.site-header { border-bottom: 1px solid var(--rule); }
.header-row, .footer, .footer-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-row { min-height: 4.4rem; flex-wrap: wrap; gap: .2rem 1rem; padding-block: .4rem; }
.header-controls { display: flex; align-items: center; gap: clamp(.35rem, 2vw, 1rem); }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle[hidden],
.theme-toggle[aria-pressed="false"] .theme-sun,
.theme-toggle[aria-pressed="true"] .theme-moon { display: none; }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle:hover { border-color: var(--green); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-weight: 740;
  font-size: 1.25rem;
  letter-spacing: -.07em;
}
.brand img { width: 2rem; height: 2rem; border-radius: .55rem; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem clamp(.75rem, 3vw, 1.8rem); }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 620;
  text-decoration: none;
}
nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }

.hero {
  display: grid;
  align-items: end;
  gap: clamp(1rem, 2.5vw, 2.4rem);
  padding-block: clamp(3.4rem, 6.6vw, 6.6rem) clamp(2.9rem, 5.9vw, 5.75rem);
  animation: enter .5s ease-out both;
}
.hero h1 {
  font-size: clamp(3.05rem, 9.2vw, 8rem);
  font-weight: 690;
  letter-spacing: -.09em;
  line-height: .94;
  margin: 0;
}
.hero h1 span { display: block; color: var(--green); }
.about p {
  margin: 0;
  color: var(--muted);
  max-width: 34ch;
  font-size: clamp(1.03rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  letter-spacing: -.018em;
}
.section-heading { border-top: 1px solid var(--rule); padding-top: 1.4rem; margin-bottom: 1.2rem; }
.section-heading h2, .about h2 {
  margin: 0;
  font-weight: 670;
  letter-spacing: -.06em;
  font-size: clamp(1.8rem, 3.7vw, 2.6rem);
  line-height: 1.1;
}
.apps-grid { display: grid; gap: 1.3rem; }
.app-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 1.4rem;
  background: var(--card);
  transition: border-color .22s ease, transform .22s ease;
}
.app-preview { display: block; }
.app-preview:focus-visible { outline-offset: -4px; position: relative; z-index: 1; }
.app-visual {
  position: relative;
  isolation: isolate;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: light-dark(var(--app-accent), color-mix(in srgb, var(--app-accent) 22%, #141b16));
  padding: clamp(1.15rem, 3.2vw, 2.15rem) clamp(1.1rem, 3.6vw, 2.45rem) 0;
}
.app-visual .screen {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid #222c27;
  border-bottom: 0;
  border-radius: .65rem .65rem 0 0;
  background: #161a19;
  box-shadow: 0 10px 28px #26302b25;
  transform-origin: 50% 25%;
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.screen img { width: 100%; height: auto; }
.app-visual.placeholder .screen {
  display: grid;
  align-content: center;
  justify-items: center;
  background: #edf3ea;
  color: #405244;
  border: 1px dashed #819583;
  border-radius: .65rem;
  height: 88%;
  font-size: .9rem;
}
.app-visual.placeholder img { width: 3.15rem; height: 3.15rem; margin-bottom: .65rem; }

.app-details { display: flex; flex: 1; flex-direction: column; align-items: start; padding: clamp(1.25rem, 3vw, 2rem); }
.app-title { display: flex; align-items: center; gap: .86rem; margin-bottom: .85rem; }
.app-title img { width: 3.15rem; height: 3.15rem; flex: none; border-radius: .83rem; }
.app-title h3 { font-size: clamp(1.65rem, 3vw, 2.1rem); letter-spacing: -.065em; line-height: 1; margin: 0 0 .27rem; }
.app-title p { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 550; }
.description { margin: 0; line-height: 1.6; color: var(--muted); }
.features { margin: 1.1rem 0 1.4rem; padding: 0; list-style: none; line-height: 1.5; }
.features li { display: flex; gap: .65rem; margin-bottom: .32rem; font-size: .94rem; }
.features li::before {
  content: "";
  width: .39rem;
  height: .39rem;
  flex: 0 0 .39rem;
  align-self: start;
  margin-top: .54rem;
  border-radius: 50%;
  background: var(--green);
}
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.15rem;
  min-height: 2.85rem;
  margin-top: auto;
  border-radius: .65rem;
  font-weight: 680;
  font-size: .91rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: transform .16s ease, background .16s ease;
}
.action:hover { background: light-dark(#375442, #a2caaa); }
.action:active { transform: scale(.97); }
.action[aria-disabled="true"] { background: #e7ebe5; color: #46514a; }
.about {
  display: grid;
  gap: .95rem;
  margin-top: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--rule);
  padding-block: clamp(1.9rem, 5vw, 4rem);
}
.about p { max-width: 50ch; }
.developer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem clamp(1.5rem, 5vw, 4rem);
  margin-top: .6rem;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--card);
}
.signature { width: min(100%, 14rem); height: auto; filter: brightness(0) invert(1); mix-blend-mode: difference; }
.developer h3 { margin: 0 0 .55rem; font-size: 1rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.contact-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .5rem;
  padding-inline: .75rem;
  border: 1px solid var(--rule);
  border-radius: .6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
}
.contact-links a:hover { border-color: var(--green); text-decoration: underline; }
.footer { border-top: 1px solid var(--rule); padding-block: 1rem 1.6rem; flex-wrap: wrap; gap: .45rem 1.8rem; }
.footer-identity { justify-content: start; flex-wrap: wrap; gap: .5rem 1rem; }
.footer small { color: var(--muted); }

@keyframes enter {
  from { opacity: 0; translate: 0 .65rem; }
  to { opacity: 1; translate: 0 0; }
}
[data-reveal].arrived { animation: enter .45s ease-out both; }
@media (min-width: 44rem) {
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr 1fr; }
}
@media (hover: hover) and (pointer: fine) {
  .app-card:hover { border-color: #a3b2a4; transform: translateY(-3px); }
  .app-card:hover .screen { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .app-card:hover, .app-card:hover .screen, .action:active { transform: none; }
}
