/* andyotto.com
   Two themes share one skeleton:
   [data-theme="warm"]  — landing + bio
   [data-theme="tech"]  — software
   Nav, footer, and spacing stay constant so the seam reads as intentional. */

:root {
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --rhythm: clamp(3.5rem, 9vw, 6rem);
}

[data-theme="warm"] {
  --bg: #faf8f4;
  --bg-sunk: #f2eee6;
  --ink: #2c2a26;
  --ink-soft: #5f594f;
  --ink-faint: #8d8578;
  --rule: #e2dbcd;
  --accent: #9a5b3f;
  --accent-soft: #b98a6e;
  --font-body: var(--serif);
  --font-ui: var(--sans);
}

[data-theme="tech"] {
  --bg: #0f1115;
  --bg-sunk: #171a21;
  --ink: #e7e9ee;
  --ink-soft: #a2a9b8;
  --ink-faint: #6b7383;
  --rule: #262b36;
  --accent: #6fa8ff;
  --accent-soft: #9ac1ff;
  --font-body: var(--sans);
  --font-ui: var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Sits inside .wrap, so it must not re-center — it shares the left edge with headings. */
.prose { max-width: var(--measure); margin-inline: 0; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-soft); }

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

/* ---- nav (constant across both themes) ---- */

.nav {
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-ui);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.15rem;
  flex-wrap: wrap;
}
.nav__mark {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 1.85rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}
.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 0.15rem;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- hero ---- */

.hero { padding-block: var(--rhythm); }

/* Portrait sits left of the name on wide screens. The markup keeps the name
   first so that stacked (and screen-reader) order still leads with who he is;
   grid placement does the visual swap rather than DOM order. */
.hero--split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.hero__figure {
  margin: 0;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.hero__text {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

.hero__portrait {
  width: 100%;
  height: auto;
  max-width: 16.5rem;
  border-radius: 4px;
  /* Warm, low-contrast lift so the photo sits in the cream rather than on it. */
  box-shadow: 0 1px 2px rgba(58, 44, 32, 0.06), 0 12px 32px rgba(58, 44, 32, 0.12);
}

@media (max-width: 46rem) {
  /* Single column: fall back to source order, so the name leads. */
  .hero--split { grid-template-columns: 1fr; }
  .hero__figure, .hero__text { grid-column: auto; grid-row: auto; }
  .hero__portrait { max-width: 11.25rem; }
}

.hero__name {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  font-weight: 400;
}
.hero__lede {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem);
  color: var(--ink-soft);
  max-width: 32rem;
  margin: 0 0 2.5rem;
  line-height: 1.55;
}

/* ---- the two doorways on the landing page ---- */

.doors {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  padding-bottom: var(--rhythm);
}
.door {
  display: block;
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.door:hover {
  border-color: var(--accent-soft);
  background: var(--bg-sunk);
  transform: translateY(-2px);
}
.door__kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}
.door__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 0.55rem;
  color: var(--ink);
}
.door__body {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}
.door__more {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 1.1rem 0 0;
}

/* ---- generic page head ---- */

.page-head { padding-block: var(--rhythm) 0; }
.page-head__title {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 1rem;
}
.page-head__sub {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0;
}

[data-theme="tech"] .page-head__title {
  font-family: var(--sans);
  font-weight: 620;
  letter-spacing: -0.025em;
}

/* ---- bio ---- */

.bio { padding-block: 2.5rem var(--rhythm); }
.bio p { margin: 0 0 1.4rem; }
.bio p:first-of-type::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.05em 0.09em 0 0;
  color: var(--accent);
}
.bio h2 {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 3rem 0 1.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}

.pullquote {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--accent);
  border-left: 2px solid var(--accent-soft);
  padding-left: 1.4rem;
  margin: 2.5rem 0;
  max-width: 30rem;
}

.facts {
  font-family: var(--sans);
  font-size: 0.92rem;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.facts li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
}
.facts dt, .facts .facts__k {
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
@media (max-width: 30rem) {
  .facts li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---- software grid ---- */

/* One app per row, stacked. Icon in a fixed left column; name, body and
   download share the right column. */
.apps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 2.75rem var(--rhythm);
}

/* Platform divider inside the stack ("macOS", "iOS"). It's a flex item like
   the cards, so it sits in the normal flow; the extra top margin separates
   the groups without needing a wrapper element per platform. */
.apps__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  /* No text-transform: uppercasing would render these "MACOS" / "IOS". The
     platform names are cased deliberately, same as the per-card tag line. */
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule);
}
.app + .apps__label { margin-top: 1.9rem; }

.app {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.6rem 1.75rem;
  background: var(--bg-sunk);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  /* Rows must be explicit: `grid-row: 1 / -1` on the icon resolves against the
     EXPLICIT grid, so without this the icon would occupy row 1 alone and its
     height would pad the heading row. Three rows = head, body, links. */
  grid-template-rows: auto auto auto;
  column-gap: 1.75rem;
  row-gap: 0.55rem;
  align-items: start;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.app:hover {
  border-color: #39414f;
  transform: translateY(-2px);
}

/* Icon occupies the full height of the row, beside every text row. */
.app__icon {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 72px;
  height: 72px;
  border-radius: 15px;
  background: linear-gradient(150deg, #2a3140, #1b2029);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  overflow: hidden;
}
.app__head, .app__body, .app__links { grid-column: 2; }

@media (max-width: 34rem) {
  /* Too narrow for a side-by-side row: put the icon above the text. */
  .app { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 0.7rem; }
  .app__icon { grid-row: auto; grid-column: 1; width: 60px; height: 60px; }
  .app__head, .app__body, .app__links { grid-column: 1; }
}
.app__icon img { width: 100%; height: 100%; object-fit: contain; }

/* Real .icns exports carry their own shape + transparent margin, so the
   placeholder tile's gradient and border must get out of the way. */
.app__icon--img {
  background: none;
  border: none;
  border-radius: 0;
}


.app__name {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.app__tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0.3rem 0 0;
  letter-spacing: 0.02em;
}
.app__body {
  font-size: 0.93rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
  /* Rows are far wider than the old cards — cap the line length so the prose
     stays readable instead of running the full width of the page. */
  max-width: 42rem;
}
.app__links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  margin-top: 0.35rem;
  max-width: 42rem;
}
.app__links a { text-decoration: none; }
.app__links a::after { content: " →"; }

/* ---- footer ---- */

.foot {
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  color: var(--ink-faint);
  padding-block: 2rem 3rem;
}
.foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot__links { display: flex; gap: 1.4rem; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
