:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #15803d;
  --accent-text: #ffffff;
  --error: #b42318;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #38383a;
    --accent: #30d158;
    --accent-text: #000000;
    --error: #ff6961;
  }
  .shot-watch { box-shadow: 0 0 0 1px var(--line); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
header.site .brand { color: var(--text); font-weight: 600; }
header.site nav { display: flex; gap: 20px; font-size: 15px; }
header.site nav a { color: var(--muted); }
header.site nav a[aria-current="page"], header.site nav a:hover { color: var(--text); text-decoration: none; }

main { padding: 56px 0 72px; }
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; margin: 56px 0 16px; font-weight: 650; }
h3 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
p { margin: 0 0 16px; }
.lead { font-size: 21px; color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.button {
  display: inline-block; padding: 11px 20px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.05); }
.button.secondary { background: var(--surface); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Home: app list */
.apps { display: grid; gap: 16px; margin-top: 24px; }
.app-card {
  display: flex; gap: 20px; align-items: center; padding: 20px; border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.app-card:hover { text-decoration: none; }
.app-card img { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.app-card p { margin: 0; color: var(--muted); }

/* Project pages */
.project-hero .icon { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 20px; }
.note { margin-top: 32px; font-size: 15px; }

.badge {
  display: inline-block; margin: 0 0 12px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); vertical-align: middle;
}
.app-card .badge { margin: 0 0 0 6px; font-size: 12px; }
ul.links { padding-left: 20px; }
ul.links li { margin-bottom: 6px; }

/* Home: work */
ul.work { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
ul.work li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
ul.work h3 { margin: 0 0 2px; }
ul.work p { margin: 0; }

/* Blog */
.posts { list-style: none; padding: 0; margin: 24px 0 0; }
.posts li { padding: 20px 0; border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts h3 { font-size: 21px; margin: 0 0 4px; }
.posts h3 a { color: var(--text); }
.posts p { margin: 6px 0 0; color: var(--muted); }
.post-date { color: var(--muted); font-size: 15px; }
.post h1 { margin-bottom: 8px; }
.post .body { margin-top: 32px; }
.post .body h2 { font-size: 24px; margin-top: 40px; }
.post .body h3 { font-size: 19px; margin-top: 28px; }
.post .body ul, .post .body ol { padding-left: 22px; margin: 0 0 16px; }
.post .body img { border-radius: 10px; margin: 8px 0 16px; }
.post .body blockquote { margin: 0 0 16px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.post .body code { font: 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); padding: 1px 5px; border-radius: 5px; }
.post .body pre { background: var(--surface); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.post .body pre code { background: none; padding: 0; }
.post .body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* App page */
.app-hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.app-hero .icon { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 20px; }
.shots { display: flex; gap: 16px; align-items: flex-start; }
.shot-watch { width: 190px; border-radius: 40px; background: #000; padding: 10px; }
.shot-watch img { border-radius: 30px; }
.shot-phone { width: 230px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.gallery { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.gallery figure { margin: 0; flex: none; }
.gallery figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 220px; }

.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Text pages */
.prose h2 { font-size: 21px; margin-top: 36px; }
.prose ul { padding-left: 20px; margin: 0 0 16px; }

/* Form */
form.contact { display: grid; gap: 18px; margin-top: 24px; }
form.contact label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
form.contact input, form.contact select, form.contact textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
form.contact textarea { min-height: 180px; resize: vertical; }
form.contact input:focus, form.contact select:focus, form.contact textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent;
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--surface); }
.notice.error { color: var(--error); }
[hidden] { display: none !important; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer.site nav { display: flex; gap: 16px; }
footer.site a { color: var(--muted); }

@media (max-width: 760px) {
  main { padding: 36px 0 56px; }
  h1 { font-size: 32px; }
  .lead { font-size: 19px; }
  .app-hero { grid-template-columns: 1fr; gap: 28px; }
  .features { grid-template-columns: 1fr; }
  .shot-watch { width: 150px; }
  .shot-phone { width: 170px; }
  header.site nav { gap: 14px; }
}
