:root {
  --bg: #f5f1ea;
  --bg-tint: #ece6da;
  --ink: #1a1814;
  --ink-mid: #3a342c;
  --ink-dim: #58524a;
  --ink-faint: #8a8278;
  --rule: rgba(26, 24, 20, 0.10);
  --rule-strong: rgba(26, 24, 20, 0.28);
  --measure: 64ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

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

::selection { background: var(--ink); color: var(--bg); }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 40px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fade-in 700ms ease-out 80ms forwards;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Nav --- */

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 80px;
  font-size: 14px;
  line-height: 1;
}

.nav-brand {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--ink-dim);
}

.nav-links a {
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

/* --- Masthead --- */

.masthead {
  margin-bottom: 72px;
}

.masthead h1 {
  font-size: 38px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}

.masthead .lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-mid);
  margin-top: 24px;
  max-width: 52ch;
  font-weight: 400;
  text-wrap: pretty;
}

/* --- Long-form article --- */

.article {
  max-width: 62ch;
}

.article p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-mid);
  margin-top: 1.1em;
  text-wrap: pretty;
}

.article p:first-of-type {
  margin-top: 0;
}

.article h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-top: 2.4em;
  line-height: 1.3;
}

.article h2 + p {
  margin-top: 0.5em;
}

.article a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 180ms ease;
}

.article a:hover {
  border-bottom-color: var(--ink);
}

.article strong {
  font-weight: 600;
  color: var(--ink);
}

/* --- Figures (screenshots / placeholders) --- */

.figure {
  margin: 40px 0;
}

.figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-faint);
  font-style: italic;
  max-width: 50ch;
}

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

/* --- Screenshot images --- */

.screenshot-mac {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.screenshot-iphone {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.iphone-pair {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.iphone-pair img {
  display: block;
  height: 480px;
  width: auto;
}

.portrait-photo {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

/* --- Studio block (home) --- */

.studio-block {
  margin-top: 96px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}

.studio-block h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}

.studio-block p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 60ch;
  margin-top: 14px;
  text-wrap: pretty;
}

.studio-block a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 180ms ease;
}

.studio-block a:hover {
  border-bottom-color: var(--ink);
}

/* --- App entries on home --- */

.apps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
}

.app-entry {
  padding: 32px 0;
}

.app-entry:last-child {
  border-bottom: none;
}

.app-entry h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}

.app-entry .meta {
  display: block;
  font-size: 14px;
  color: var(--ink-faint);
  margin-top: 4px;
  letter-spacing: 0;
}

.app-entry p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 58ch;
  margin-top: 14px;
  text-wrap: pretty;
}

.app-entry .read-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color 180ms ease;
}

.app-entry .read-more:hover {
  border-bottom-color: var(--ink);
}

/* --- Studio card (used on About + product detail pages) --- */

.studio-card {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.studio-card h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}

.studio-card p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 60ch;
  text-wrap: pretty;
}

.studio-card address {
  font-style: normal;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-mid);
}

.studio-card a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 180ms ease;
}

.studio-card a:hover {
  border-bottom-color: var(--ink);
}

.studio-card .visit {
  display: inline-block;
  margin-top: 18px;
  font-size: 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* --- Footer --- */

.footer {
  margin-top: auto;
  padding-top: 120px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.footer .footer-line {
  display: block;
}

.footer .footer-line + .footer-line {
  margin-top: 4px;
}

.footer a {
  color: var(--ink-mid);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}

.footer a:hover {
  border-bottom-color: var(--rule-strong);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .page { padding: 32px 22px 48px; }
  .nav { margin-bottom: 56px; }
  .masthead { margin-bottom: 56px; }
  .masthead h1 { font-size: 30px; line-height: 1.22; }
  .masthead .lead { font-size: 18px; margin-top: 22px; }

  .article p,
  .app-entry p { font-size: 17px; }
  .article .lead { font-size: 19px; }
  .article h2 { font-size: 18px; margin-top: 2.2em; }

  .app-entry { padding: 26px 0; }
  .app-entry h2 { font-size: 20px; }
  .app-entry .meta { font-size: 13px; }
  .app-entry p { font-size: 17px; }

  .studio-block { margin-top: 64px; }
  .studio-card { margin-top: 56px; }
  .studio-card p { font-size: 17px; }

  .screenshot-iphone { width: 240px; }
  .iphone-pair img { height: 360px; }
  .portrait-photo { width: 280px; }
  .figure { margin: 28px 0; }

  .footer { padding-top: 88px; }
}
