:root {
  --paper: #faf9f6;
  --ink: #262b26;
  --body: #3a403a;
  --muted: #676d66;
  --line: #e3e5dd;
  --accent: #315c46;
  --tile: #e8eee4;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Spacing scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 28px; }
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 180ms; animation-timing-function: ease-in-out; }
::view-transition-old(root) { animation: page-out 180ms ease-in-out both; }
::view-transition-new(root) { animation: page-in 180ms ease-in-out both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
::selection { background: #dbe7d9; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.skip { position: fixed; z-index: 100; top: 12px; left: 12px; background: var(--ink); color: var(--paper); padding: 8px 15px; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }
.wrap { width: min(680px, calc(100% - 48px)); margin-inline: auto; }

/* Header and footer */
.site-header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding-top: var(--s5); }
.name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.site-header nav { display: flex; gap: var(--s3); font-size: 14px; color: var(--muted); }
.site-header nav a:hover, .site-footer a:hover, .back-link:hover { color: var(--accent); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); padding: var(--s3) 0 var(--s5); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Homepage */
.intro { margin: var(--s6) 0; }
.intro h1 { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; margin: 0 0 var(--s1); text-wrap: balance; }
.intro p { margin: 0; font-size: 18px; color: var(--muted); }
.section-label { font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--muted); margin: 0 0 var(--s3); }

/* Projects: title, status, description, then a full-width screenshot in a shared 16:10 frame */
.project-list { display: grid; gap: var(--s6); }
.project-link { display: block; }
.project-link h3 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; margin: 0; }
.link-arrow { display: inline-block; margin-left: 4px; font-weight: 400; color: var(--muted); transition: transform 160ms ease; }
.project-meta { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.project-desc { font-size: 16px; color: var(--body); margin: var(--s1) 0 0; max-width: 60ch; }
.project-link:hover h3 { color: var(--accent); }
.project-link:hover .link-arrow { transform: translateX(2px); color: var(--accent); }
.project-link:hover .frame { border-color: #c9d0c3; }

.frame { margin: 20px 0 0; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: border-color 160ms ease; }
.frame > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.frame.phone { display: flex; justify-content: center; align-items: flex-start; padding-top: var(--s4); background: var(--tile); }
.frame.phone > img { width: 34%; height: auto; object-fit: initial; border-radius: 22px 22px 0 0; box-shadow: 0 0 0 1px rgba(38, 60, 44, .08), 0 10px 30px rgba(38, 60, 44, .14); }

.about { margin-top: var(--s6); }
.about p { color: var(--body); margin: 0 0 var(--s2); max-width: 60ch; }
.inline-link { color: var(--ink); text-decoration: underline; text-decoration-color: #b9c3b3; text-underline-offset: 4px; }
.inline-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Project pages */
.back-link { font-size: 14px; color: var(--muted); }
.case-header { margin-top: var(--s5); }
.case-header h1 { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin: var(--s2) 0 var(--s1); text-wrap: balance; }
.case-deck { margin: 0; font-size: 18px; color: var(--muted); max-width: 58ch; }
.case-meta { margin: var(--s2) 0 0; font-size: 14px; color: var(--muted); }
.case-meta strong { color: var(--ink); font-weight: 500; }
.button { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s3); padding: 9px 16px; border: 1px solid var(--ink); border-radius: 6px; font-size: 14px; font-weight: 500; transition: background 160ms ease, color 160ms ease; }
.button:hover { background: var(--ink); color: var(--paper); }
.case-hero { margin: var(--s5) 0 0; }
.case-hero a { display: block; cursor: zoom-in; }
figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.shot { margin: var(--s4) 0; }
.shot .frame, .case-hero .frame { margin: 0; }
.case-section { margin-top: var(--s6); }
.case-section h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; }
.case-prose p { font-size: 16px; line-height: 1.75; color: var(--body); margin: 0 0 var(--s2); }
.case-prose p.small { color: var(--muted); font-size: 14px; }
.decision { margin: var(--s3) 0; padding: 2px 0 2px 20px; border-left: 2px solid #b9c8b2; }
.decision .label { font-size: 13px; color: var(--muted); }
.decision p.before, .decision p.after { font-size: 17px; margin: var(--s1) 0; }
.decision .before { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.decision .after { color: var(--accent); }
.case-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); margin-top: var(--s6); font-size: 15px; }

.screen-dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); width: min(420px, calc(100% - 24px)); max-height: 92vh; padding: 48px 16px 16px; }
.screen-dialog::backdrop { background: rgba(32, 43, 35, .78); }
.screen-dialog button { position: absolute; top: 12px; right: 14px; font-size: 13px; background: transparent; color: var(--ink); border: 1px solid #a7b19f; border-radius: 6px; padding: 3px 10px; cursor: pointer; }

/* Writing (template only until the first post) */
.post-header { margin-top: var(--s5); margin-bottom: var(--s4); }
.post-header h1 { font-size: 32px; font-weight: 600; line-height: 1.25; letter-spacing: -.03em; margin: var(--s2) 0 12px; text-wrap: balance; }
.post-header time { color: var(--muted); font-size: 14px; }
.post-body { font-size: 17px; line-height: 1.8; color: var(--body); }
.post-body p { margin: 0 0 var(--s3); }
.post-body h2 { font-size: 22px; line-height: 1.35; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 40px 0 var(--s2); }
.post-body h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin: var(--s4) 0 12px; }
.post-body a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #aab9a4; }
.post-body blockquote { margin: 28px 0; padding-left: 22px; border-left: 2px solid #b9c8b2; color: var(--muted); }
.post-body pre { padding: 15px; background: #eeeee9; font-size: 13px; overflow-x: auto; border-radius: 4px; }
.post-body figure { margin: 28px 0; }
.post-body figcaption { margin-top: 9px; }

@media (max-width: 600px) {
  .site-header { padding-top: var(--s4); }
  .site-header nav { gap: var(--s2); }
  .intro { margin: var(--s5) 0; }
  .intro h1 { font-size: 26px; }
  .intro p { font-size: 17px; }
  .project-list { gap: var(--s5); }
  .project-link h3 { font-size: 19px; }
  .frame { margin-top: var(--s2); }
  .frame.phone { padding-top: 20px; }
  .frame.phone > img { width: 42%; border-radius: 16px 16px 0 0; }
  .about { margin-top: var(--s5); }
  .case-header { margin-top: var(--s4); }
  .case-header h1 { font-size: 28px; }
  .case-deck { font-size: 17px; }
  .case-section { margin-top: var(--s5); }
  .post-header h1 { font-size: 28px; }
  .post-body { font-size: 16px; }
}
@media (max-width: 370px) {
  .wrap { width: calc(100% - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
