/* Default palette: DishFork (dishfork.com). */
:root {
  --radius-control: 8px;
  --radius-menu: 16px;
  --radius-card: 24px;
  --radius-panel: 32px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --surface-border-lightness-step: 0.035;
  --bg: #FBF7F2;
  --card: #FFFFFF;
  --text: #201C19;
  --text-2: #6B615A;
  --hairline: rgba(32, 28, 25, 0.09);
  --nav-bg: rgba(251, 247, 242, 0.74);
  --device: #1C1815;
  --accent: #B6492E;
  --button: #B6492E;
  --on-button: #FFFFFF;
  --glow: rgba(182, 73, 46, 0.18);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(222, 122, 87, 0.20), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(237, 176, 74, 0.20), transparent 70%),
    linear-gradient(#F6ECE1, #FBF7F2 62%);
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
    --bg: #201C19;
    --card: #2C2724;
    --text: #FBF7F2;
    --text-2: #A99D93;
    --hairline: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(32, 28, 25, 0.74);
    --device: #0E0C0B;
    --accent: #DE7A57;
    --glow: rgba(182, 73, 46, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(182, 73, 46, 0.40), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(237, 176, 74, 0.14), transparent 70%),
      linear-gradient(#2B231F, #201C19 62%);
  }
}

:root[data-theme="dark"] {
    --bg: #201C19;
    --card: #2C2724;
    --text: #FBF7F2;
    --text-2: #A99D93;
    --hairline: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(32, 28, 25, 0.74);
    --device: #0E0C0B;
    --accent: #DE7A57;
    --glow: rgba(182, 73, 46, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(182, 73, 46, 0.40), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(237, 176, 74, 0.14), transparent 70%),
      linear-gradient(#2B231F, #201C19 62%);
  }


/* Portfolio: warm neutrals with restrained blue accents. */
.theme-portfolio {
  --bg: #F8F7F4;
  --card: #FFFFFF;
  --text: #22252A;
  --text-2: #656970;
  --hairline: rgba(34, 37, 42, 0.09);
  --nav-bg: rgba(248, 247, 244, 0.74);
  --device: #22252A;
  --accent: #345F91;
  --button: #345F91;
  --on-button: #FFFFFF;
  --glow: rgba(52, 95, 145, 0.12);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(137, 166, 200, 0.28), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(224, 210, 187, 0.25), transparent 70%),
    linear-gradient(#EAF0F6, #F8F7F4 62%);
}

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .theme-portfolio {
    --bg: #191A1C;
    --card: #242629;
    --text: #F5F4F0;
    --text-2: #ADB1B8;
    --hairline: rgba(245, 244, 240, 0.08);
    --nav-bg: rgba(25, 26, 28, 0.74);
    --device: #0D0E10;
    --accent: #ACC8EA;
    --button: #ACC8EA;
    --on-button: #172536;
    --glow: rgba(97, 128, 167, 0.18);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(97, 128, 167, 0.18), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(160, 145, 123, 0.10), transparent 70%),
      linear-gradient(#202329, #191A1C 62%);
  }
}

:where(:root[data-theme="dark"]) .theme-portfolio {
    --bg: #191A1C;
    --card: #242629;
    --text: #F5F4F0;
    --text-2: #ADB1B8;
    --hairline: rgba(245, 244, 240, 0.08);
    --nav-bg: rgba(25, 26, 28, 0.74);
    --device: #0D0E10;
    --accent: #ACC8EA;
    --button: #ACC8EA;
    --on-button: #172536;
    --glow: rgba(97, 128, 167, 0.18);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(97, 128, 167, 0.18), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(160, 145, 123, 0.10), transparent 70%),
      linear-gradient(#202329, #191A1C 62%);
  }


/* Reeve page uses Reeve's palette (reevemoney.com) */
.theme-reeve {
  --bg: #F2F7F8;
  --card: #FFFFFF;
  --text: #0B2530;
  --text-2: #4C6972;
  --hairline: rgba(11, 37, 48, 0.08);
  --nav-bg: rgba(242, 247, 248, 0.72);
  --accent: #077D8A;
  --button: #077D8A;
  --on-button: #FFFFFF;
  --glow: rgba(10, 176, 192, 0.16);
  --field: radial-gradient(520px 520px at 12% -2%, rgba(10, 176, 192, 0.16), transparent 70%),
    radial-gradient(480px 480px at 92% 4%, rgba(224, 184, 96, 0.16), transparent 70%),
    linear-gradient(#E3EFF2, #F2F7F8 60%, #F0F5F7);
}

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .theme-reeve {
    --bg: #011C24;
    --card: #042A35;
    --text: #EAF7F9;
    --text-2: #76A3AE;
    --hairline: rgba(255, 255, 255, 0.07);
    --nav-bg: rgba(1, 28, 36, 0.72);
    --accent: #2FE0E6;
    --button: #2FE0E6;
    --on-button: #011C24;
    --glow: rgba(10, 176, 192, 0.38);
    --field: radial-gradient(520px 520px at 12% -2%, rgba(10, 176, 192, 0.38), transparent 70%),
      radial-gradient(480px 480px at 92% 4%, rgba(28, 110, 116, 0.34), transparent 70%),
      linear-gradient(#023644, #011C24 60%, #021A22);
  }
}

:where(:root[data-theme="dark"]) .theme-reeve {
    --bg: #011C24;
    --card: #042A35;
    --text: #EAF7F9;
    --text-2: #76A3AE;
    --hairline: rgba(255, 255, 255, 0.07);
    --nav-bg: rgba(1, 28, 36, 0.72);
    --accent: #2FE0E6;
    --button: #2FE0E6;
    --on-button: #011C24;
    --glow: rgba(10, 176, 192, 0.38);
    --field: radial-gradient(520px 520px at 12% -2%, rgba(10, 176, 192, 0.38), transparent 70%),
      radial-gradient(480px 480px at 92% 4%, rgba(28, 110, 116, 0.34), transparent 70%),
      linear-gradient(#023644, #011C24 60%, #021A22);
  }


/* Renfo page uses the Renfo icon's palette: crimson field, gold crown */
.theme-renfo {
  --bg: #FCF8F0;
  --card: #FFFFFF;
  --text: #321416;
  --text-2: #775C55;
  --hairline: rgba(50, 20, 22, 0.09);
  --nav-bg: rgba(252, 248, 240, 0.74);
  --device: #1E0709;
  --accent: #AD2027;
  --button: #AD2027;
  --on-button: #FFFFFF;
  --glow: rgba(173, 32, 39, 0.18);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(173, 32, 39, 0.18), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(245, 212, 119, 0.26), transparent 70%),
    linear-gradient(#F8EEDC, #FCF8F0 62%);
}

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .theme-renfo {
    --bg: #1C090B;
    --card: #2D1215;
    --text: #FFF4DF;
    --text-2: #C7ABA0;
    --hairline: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(28, 9, 11, 0.74);
    --device: #0D0304;
    --accent: #F5D477;
    --button: #F5D477;
    --on-button: #321416;
    --glow: rgba(173, 32, 39, 0.34);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(173, 32, 39, 0.36), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(245, 212, 119, 0.14), transparent 70%),
      linear-gradient(#351216, #1C090B 62%);
  }
}

:where(:root[data-theme="dark"]) .theme-renfo {
    --bg: #1C090B;
    --card: #2D1215;
    --text: #FFF4DF;
    --text-2: #C7ABA0;
    --hairline: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(28, 9, 11, 0.74);
    --device: #0D0304;
    --accent: #F5D477;
    --button: #F5D477;
    --on-button: #321416;
    --glow: rgba(173, 32, 39, 0.34);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(173, 32, 39, 0.36), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(245, 212, 119, 0.14), transparent 70%),
      linear-gradient(#351216, #1C090B 62%);
  }


/* Homestead: blue foundation, frosted cyan and lavender highlights. */
.theme-homestead {
  --bg: #F5F8FD;
  --card: #FFFFFF;
  --text: #17263D;
  --text-2: #56677E;
  --hairline: rgba(23, 38, 61, 0.09);
  --nav-bg: rgba(245, 248, 253, 0.74);
  --device: #17263D;
  --accent: #2E6BC2;
  --button: #2E6BC2;
  --on-button: #FFFFFF;
  --glow: rgba(46, 107, 194, 0.18);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(158, 223, 239, 0.30), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(199, 207, 249, 0.28), transparent 70%),
    linear-gradient(#EAF1FC, #F5F8FD 62%);
}

/* iWatch: brighter blue with the icon's cream and ice-blue highlights. */
.theme-iwatch {
  --bg: #F7F9FD;
  --card: #FFFFFF;
  --text: #152640;
  --text-2: #586A82;
  --hairline: rgba(21, 38, 64, 0.09);
  --nav-bg: rgba(247, 249, 253, 0.74);
  --device: #152640;
  --accent: #2467CE;
  --button: #2467CE;
  --on-button: #FFFFFF;
  --glow: rgba(57, 137, 249, 0.18);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(104, 180, 248, 0.28), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(245, 232, 211, 0.38), transparent 70%),
    linear-gradient(#EDF3FC, #F7F9FD 62%);
}

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .theme-homestead {
    --bg: #0B1526;
    --card: #14233A;
    --text: #EEF4FF;
    --text-2: #A6B6CB;
    --hairline: rgba(238, 244, 255, 0.09);
    --nav-bg: rgba(11, 21, 38, 0.74);
    --device: #060D18;
    --accent: #9EDFEF;
    --button: #9EDFEF;
    --on-button: #0B2545;
    --glow: rgba(46, 107, 194, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(46, 107, 194, 0.34), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(109, 198, 221, 0.08), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(185, 195, 245, 0.10), transparent 70%),
      linear-gradient(#12243E, #0B1526 62%);
  }
:where(:root:not([data-theme])) .theme-iwatch {
    --bg: #0C1628;
    --card: #162640;
    --text: #FAF6EF;
    --text-2: #A8B8CE;
    --hairline: rgba(250, 246, 239, 0.09);
    --nav-bg: rgba(12, 22, 40, 0.74);
    --device: #070D18;
    --accent: #9CCBFF;
    --button: #9CCBFF;
    --on-button: #102A4C;
    --glow: rgba(57, 137, 249, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(57, 137, 249, 0.42), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(155, 192, 228, 0.10), transparent 70%),
      linear-gradient(#142C4D, #0C1628 62%);
  }
}

:where(:root[data-theme="dark"]) .theme-homestead {
    --bg: #0B1526;
    --card: #14233A;
    --text: #EEF4FF;
    --text-2: #A6B6CB;
    --hairline: rgba(238, 244, 255, 0.09);
    --nav-bg: rgba(11, 21, 38, 0.74);
    --device: #060D18;
    --accent: #9EDFEF;
    --button: #9EDFEF;
    --on-button: #0B2545;
    --glow: rgba(46, 107, 194, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(46, 107, 194, 0.34), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(109, 198, 221, 0.08), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(185, 195, 245, 0.10), transparent 70%),
      linear-gradient(#12243E, #0B1526 62%);
  }
:where(:root[data-theme="dark"]) .theme-iwatch {
    --bg: #0C1628;
    --card: #162640;
    --text: #FAF6EF;
    --text-2: #A8B8CE;
    --hairline: rgba(250, 246, 239, 0.09);
    --nav-bg: rgba(12, 22, 40, 0.74);
    --device: #070D18;
    --accent: #9CCBFF;
    --button: #9CCBFF;
    --on-button: #102A4C;
    --glow: rgba(57, 137, 249, 0.35);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(57, 137, 249, 0.42), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(155, 192, 228, 0.10), transparent 70%),
      linear-gradient(#142C4D, #0C1628 62%);
  }


/* Personal app pages: neutral ground, each app's own accent */
.theme-app {
  --bg: #FFFFFF;
  --card: #F5F5F7;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --hairline: rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --device: #1D1D1F;
  --field: radial-gradient(ellipse 80% 60% at 50% 0%, var(--glow), transparent 70%);
}

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .theme-app {
    --bg: #000000;
    --card: #1C1C1E;
    --text: #F5F5F7;
    --text-2: #A1A1A6;
    --hairline: rgba(255, 255, 255, 0.12);
    --nav-bg: rgba(22, 22, 23, 0.72);
    --device: #3A3A3C;
  }
}

:where(:root[data-theme="dark"]) .theme-app {
    --bg: #000000;
    --card: #1C1C1E;
    --text: #F5F5F7;
    --text-2: #A1A1A6;
    --hairline: rgba(255, 255, 255, 0.12);
    --nav-bg: rgba(22, 22, 23, 0.72);
    --device: #3A3A3C;
  }


/* App accents: on a page's <body>, or on a home card to tint its buttons */
.accent-reeve     { --accent: #077D8A; --button: #077D8A; --on-button: #FFFFFF; --glow: rgba(10, 176, 192, 0.16); }
.accent-dishfork  { --accent: #B6492E; --button: #B6492E; --on-button: #FFFFFF; --glow: rgba(182, 73, 46, 0.18); }
.accent-renfo     { --accent: #8C2F39; --button: #8C2F39; --on-button: #FFFFFF; --glow: rgba(201, 162, 39, 0.20); }
.accent-homestead { --accent: #1560C8; --button: #1560C8; --on-button: #FFFFFF; --glow: rgba(31, 123, 230, 0.18); }
.accent-iwatch    { --accent: #0A74DC; --button: #0A74DC; --on-button: #FFFFFF; --glow: rgba(58, 168, 255, 0.20); }

@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .accent-reeve { --accent: #2FE0E6; --button: #2FE0E6; --on-button: #011C24; --glow: rgba(10, 176, 192, 0.38); }
:where(:root:not([data-theme])) .accent-dishfork { --accent: #DE7A57; --button: #DE7A57; --on-button: #201C19; --glow: rgba(182, 73, 46, 0.35); }
:where(:root:not([data-theme])) .accent-renfo { --accent: #E6C35C; --button: #E6C35C; --on-button: #2A1F02; --glow: rgba(140, 47, 57, 0.45); }
:where(:root:not([data-theme])) .accent-homestead { --accent: #9ED8F0; --button: #9ED8F0; --on-button: #0A2A55; --glow: rgba(31, 123, 230, 0.40); }
:where(:root:not([data-theme])) .accent-iwatch { --accent: #4DB2FF; --button: #4DB2FF; --on-button: #021A33; --glow: rgba(58, 168, 255, 0.36); }
}

:where(:root[data-theme="dark"]) .accent-reeve { --accent: #2FE0E6; --button: #2FE0E6; --on-button: #011C24; --glow: rgba(10, 176, 192, 0.38); }
:where(:root[data-theme="dark"]) .accent-dishfork { --accent: #DE7A57; --button: #DE7A57; --on-button: #201C19; --glow: rgba(182, 73, 46, 0.35); }
:where(:root[data-theme="dark"]) .accent-renfo { --accent: #E6C35C; --button: #E6C35C; --on-button: #2A1F02; --glow: rgba(140, 47, 57, 0.45); }
:where(:root[data-theme="dark"]) .accent-homestead { --accent: #9ED8F0; --button: #9ED8F0; --on-button: #0A2A55; --glow: rgba(31, 123, 230, 0.40); }
:where(:root[data-theme="dark"]) .accent-iwatch { --accent: #4DB2FF; --button: #4DB2FF; --on-button: #021A33; --glow: rgba(58, 168, 255, 0.36); }


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

html { scroll-behavior: smooth; }
main, section[id] { scroll-margin-top: 72px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.skip-link {
  position: fixed; top: 8px; left: 16px; z-index: 30;
  transform: translateY(-200%); padding: 12px 16px; border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.skip-link:focus { transform: none; }
:where(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .tile {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  line-height: 1.07;
}

h1 { font-size: clamp(2.75rem, 7.5vw, 5.5rem); font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.875rem, 4vw, 3rem); font-weight: 600; line-height: 1.12; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.5rem, 2.4vw, 1.75rem); font-weight: 600; line-height: 1.16; letter-spacing: -0.02em; }

section { padding: var(--space-12) var(--space-3); max-width: 1080px; margin: 0 auto; }

.eyebrow { color: var(--accent); font-size: 1.0625rem; font-weight: 600; margin-bottom: 8px; }
.lede { color: var(--text-2); font-size: clamp(1.1875rem, 2.2vw, 1.375rem); line-height: 1.4; max-width: 640px; }
.meta { color: var(--text-2); font-size: 0.75rem; margin-top: 24px; }
.section-head { text-align: center; margin-bottom: var(--space-6); }
.section-head .lede { margin: 16px auto 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(150%) blur(24px);
  -webkit-backdrop-filter: saturate(150%) blur(24px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-name { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.0625rem; font-weight: 600; }
.nav-name:hover { text-decoration: none; }
.nav-name .tile { width: 24px; height: 24px; border-radius: 6px; font-size: 0.6875rem; box-shadow: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text); font-size: 0.8125rem; opacity: 0.8; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links .pill { opacity: 1; background: var(--button); color: var(--on-button); padding: 5px 12px; border-radius: 980px; font-weight: 500; white-space: nowrap; }
.nav-links > a { min-height: 44px; display: inline-flex; align-items: center; }
.nav-name { min-height: 44px; }

/* Hero, with a soft accent glow behind it */
.hero-wrap { background: var(--field) no-repeat top / 100% 720px; }
.hero { text-align: center; padding-top: 112px; }
/* Keep the portfolio introduction close to the work it introduces. */
.theme-portfolio .hero { padding-bottom: 64px; }
.theme-portfolio #work { padding-top: 64px; }
.theme-portfolio #work { padding-bottom: 64px; }
.theme-portfolio #about { padding-top: 64px; padding-bottom: 64px; }
.theme-portfolio #contact { padding-top: 64px; }
.hero .tile { margin: 0 auto 40px; }
.hero .lede { margin: 24px auto 0; }
.hero .subhead { color: var(--accent); font-family: var(--font-display); font-size: clamp(1.375rem, 2.8vw, 1.875rem); font-weight: 600; margin-top: 24px; }
.hero .subhead + .lede { margin-top: 16px; }
.hero .device { margin-top: 72px; }
.actions { margin-top: 36px; display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: wrap; }

.theme-renfo .hero .actions,
.theme-homestead .hero .actions,
.theme-iwatch .hero .actions { flex-direction: column; gap: var(--space-2); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; background: var(--button); color: var(--on-button);
  font-size: 1.0625rem; font-weight: 600; padding: 12px 24px; border-radius: 980px;
}
.button:hover { text-decoration: none; }
.link { font-size: 1.0625rem; font-weight: 500; }
/* Apple's official badge, shown unaltered at the height of a .button */
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: 48px; width: 143.6px; }

/* App tile: a stand-in until real app icons arrive */
.tile {
  display: flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 22px;
  background: linear-gradient(145deg, var(--tile-a, #7d7bff), var(--tile-b, #4b48c9));
  color: #fff; font-size: 2.125rem; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.tile img { width: 100%; height: 100%; border-radius: inherit; display: block; }
.tile picture { width: 100%; height: 100%; border-radius: inherit; }
.tile:has(img) { background: none; }
.tile-me        { --tile-a: #EDB04A; --tile-b: #B6492E; }
/* The Memoji stands on its own: no tile background or shadow */
.tile.tile-me { background: none; box-shadow: none; }
.tile-me img { object-fit: contain; }

/* A single greeting on pointer hover; touch and reduced-motion users see a still image. */
@keyframes memoji-greeting {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  32% { transform: translateY(2px) rotate(2deg); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .theme-portfolio .hero .tile-me img { transform-origin: 50% 80%; }
  .theme-portfolio .hero .tile-me.is-greeting img { animation: memoji-greeting 650ms cubic-bezier(.4, 0, .2, 1); }
}

.tile-reeve     { --tile-a: #0AB0C0; --tile-b: #077D8A; }
.tile-dishfork  { --tile-a: #DE7A57; --tile-b: #B6492E; }
.tile-renfo     { --tile-a: #b33a46; --tile-b: #5e1a22; }
.tile-homestead { --tile-a: #2A86EC; --tile-b: #1560C8; }
.tile-iwatch    { --tile-a: #45B0FF; --tile-b: #1683F0; }

/* Landing: project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-3); }
.card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: var(--space-4);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card .tile { margin-bottom: var(--space-3); }
.card .name { color: var(--text); font-size: 1.1875rem; font-weight: 600; }
.card .badge {
  margin: 8px 0 20px; padding: 4px 10px; border-radius: 980px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-2); border: 1px solid transparent;
  background: color-mix(in srgb, var(--text-2) 9%, var(--card));
}
.card .badge-mine {
  color: var(--accent); color: color-mix(in srgb, var(--accent) 85%, var(--text) 15%);
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}
.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-2); font-size: 1.0625rem; line-height: 1.5; max-width: 340px; }
.card .actions { margin-top: auto; padding-top: var(--space-4); gap: var(--space-1); flex-direction: column; }
.card .actions .link { font-size: 0.9375rem; min-height: 44px; display: inline-flex; align-items: center; }

/* Project pages: alternating feature rows */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.feature-flip .feature-copy { order: 2; }
.feature h2 { margin-bottom: 20px; }
.feature p { color: var(--text-2); font-size: 1.1875rem; max-width: 460px; }
.role { list-style: none; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.role li { border: 1px solid var(--hairline); border-radius: 980px; padding: 6px 14px; font-size: 0.875rem; color: var(--text-2); }

/* Device frame, matching the PBL app sites: black bezel, thin titanium rim, neutral shadow.
   Drop a real screenshot into .device-screen as an <img> */
.device {
  justify-self: center; margin: 0 auto;
  width: min(300px, 78vw); aspect-ratio: 9 / 19.5;
  background: #0B0B0C; border-radius: 52px; padding: 10px;
  box-shadow: 0 0 0 1.5px #5E5E62, 0 0 0 3px rgba(0, 0, 0, 0.5), 0 30px 60px rgba(0, 0, 0, 0.28);
}
.device-screen {
  position: relative;
  width: 100%; height: 100%; border-radius: 42px; overflow: hidden;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.device-screen::before {
  content: ""; position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 28px; border-radius: 20px; background: #000;
}
.device-screen:has(img)::before { display: none; } /* real screenshots bring their own Dynamic Island */
.device-screen picture { display: contents; }
.device-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-placeholder { color: var(--text-2); font-size: 0.875rem; }

/* About + contact */
.about { text-align: center; }
.about h2 { margin-bottom: 24px; }
.about p { font-size: clamp(1.1875rem, 2.2vw, 1.375rem); color: var(--text-2); max-width: 720px; margin: 0 auto; }
.contact { text-align: center; }
.contact h2 { margin-bottom: 16px; }
.contact .lede { margin: 0 auto; }

.footer {
  border-top: 1px solid var(--hairline);
  --footer-gutter: 24px;
  width: calc(100% - 2 * var(--footer-gutter)); max-width: 1032px;
  margin: 0 auto; padding: 16px 0;
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  color: var(--text-2); font-size: 0.75rem;
}
.footer a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 44px; }
.footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Shared header appearance menu. */
.appearance { position: relative; flex-shrink: 0; }
.appearance-trigger {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
}

.appearance-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 20;
  min-width: 140px; padding: 6px; border-radius: var(--radius-menu);
  border: 1px solid var(--hairline); background: var(--bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(24px);
  -webkit-backdrop-filter: saturate(150%) blur(24px);
}
.appearance-menu[hidden] { display: none; }
.appearance-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px;
  border: 0; border-radius: var(--radius-control); font: inherit; font-size: 0.875rem;
  background: transparent; color: var(--text); cursor: pointer; text-align: left;
}
.appearance-menu button:focus-visible { background: var(--card); }
.appearance-check { width: 14px; flex-shrink: 0; text-align: center; visibility: hidden; }
.appearance-menu button[aria-checked="true"] .appearance-check { visibility: visible; }
.appearance-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  section { padding: 96px 20px; }
  .theme-portfolio #work { padding-bottom: 48px; }
  .theme-portfolio #about { padding-top: 48px; padding-bottom: 48px; }
  .theme-portfolio #contact { padding-top: 48px; }
  .hero { padding-top: 80px; }
  .feature { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .feature p { margin: 0 auto; }
  .feature-flip .feature-copy { order: 0; }
  .nav-links { gap: 10px; }
  .nav-name, .nav-links > a { min-height: 44px; display: inline-flex; align-items: center; }
  .card .actions .link, .actions > .link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Support and privacy pages share the app palette and typography. */
.document-hero { padding-bottom: 56px; }
.document-copy { max-width: 768px; margin: 0 auto; padding: 40px 24px 96px; }
.document-copy > :first-child { margin-top: 0; }
@media (max-width: 760px) { .document-copy { padding-top: 24px; } }
.document-copy h2 { font-size: clamp(1.625rem, 4vw, 2.125rem); margin: 40px 0 16px; }
.document-copy p, .document-copy li { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; }
.document-copy ul { padding-left: 24px; }
.document-copy li + li { margin-top: 12px; }
.document-copy a { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .nav-inner { padding: 0 16px; gap: 8px; }
  .nav-name { font-size: 1rem; white-space: nowrap; }
}

/* Navigation remains available when scripts are unavailable. */
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
  .nav-links { flex-wrap: wrap; }
  .nav-ready .nav-links { flex-wrap: nowrap; }
  .nav-ready .nav-links > a { display: none; }
}
.navigation-toggle {
  display: none; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.navigation-panel {
  position: absolute; top: calc(100% + 8px); right: max(16px, calc((100vw - 1032px) / 2));
  width: min(200px, calc(100vw - 32px)); padding: 8px; border-radius: var(--radius-menu);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--hairline); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: saturate(150%) blur(24px); -webkit-backdrop-filter: saturate(150%) blur(24px);
}
.navigation-panel[hidden] { display: none; }
.navigation-panel a {
  display: flex; align-items: center; min-height: 48px; padding: 12px 16px;
  border-radius: var(--radius-control); color: var(--text); font-size: 1.0625rem; font-weight: 500;
}
.navigation-panel a:focus-visible { background: var(--card); text-decoration: none; }
@media (max-width: 760px) { .nav-ready .navigation-toggle { display: inline-flex; } }

.button, .professional-pill, .nav-links .pill, .appearance-trigger, .navigation-toggle, .link {
  transition: background-color 160ms ease, filter 160ms ease, transform 160ms ease;
}
.button:active, .professional-pill:active, .nav-links .pill:active, .appearance-trigger:active, .navigation-toggle:active {
  transform: scale(.97); filter: brightness(.94);
}

@keyframes popover-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.appearance-menu:not([hidden]), .navigation-panel:not([hidden]) { animation: popover-in 160ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .button, .professional-pill, .nav-links .pill, .appearance-trigger, .navigation-toggle, .link { transition: none; }
  .appearance-menu:not([hidden]), .navigation-panel:not([hidden]) { animation: none; }
  .button:active, .professional-pill:active, .nav-links .pill:active, .appearance-trigger:active, .navigation-toggle:active { transform: none; }
}

/* Product presentation: quieter chrome, clear reading order, and real imagery. */
.nav-links .pill { position: relative; min-height: 32px; margin-block: 6px; }
.nav-links .pill::before { content: ""; position: absolute; inset: -6px 0; }
.hero { padding-top: 72px; }
.hero .tile { margin-bottom: 28px; }
.hero .subhead { font-family: var(--font-text); font-size: clamp(1.25rem, 2.4vw, 1.625rem); }
.hero .actions { margin-top: 28px; }
.hero .device { margin-top: 48px; }
.hero .lede, .card h3, .section-head h2 { text-wrap: balance; }
/* Subtle fallback for browsers without relative colors. */
.card, .contact, .professional-pill, .button, .nav-links > .pill, .appearance-menu, .navigation-panel, .app-site .nav-floating .nav-inner {
  --border-filled: color-mix(in srgb, var(--surface-border-color, var(--card)), var(--surface-border-contrast, var(--text)) 16%);
  --border-surface: color-mix(in srgb, var(--surface-border-color, var(--card)), var(--surface-border-contrast, var(--text)) 4%);
  --surface-border: var(--border-surface);
}
/* Neutral edges stay quiet; chromatic fills receive a gradual boost capped at 0.065. */
@supports (color: oklch(from white calc(l + 0.01) c h)) {
  .card, .contact, .professional-pill, .button, .nav-links > .pill, .appearance-menu, .navigation-panel, .app-site .nav-floating .nav-inner {
    --border-surface: oklch(from var(--surface-border-color, var(--card)) calc(l + clamp(calc(0 - var(--surface-border-lightness-step) - clamp(0, (c - 0.02) * 0.3, 0.03)), calc((0.65 - l) * 1000), calc(var(--surface-border-lightness-step) + clamp(0, (c - 0.02) * 0.3, 0.03)))) c h);
  }
}
.appearance-menu, .navigation-panel { --surface-border-color: var(--bg); border-color: var(--surface-border); }
.card { --surface-border-color: var(--card); border-color: var(--surface-border); box-shadow: none; }
.card .badge, .card .badge-mine { background: transparent; color: var(--text-2); font-weight: 400; padding: 0; margin: var(--space-1) 0 var(--space-2); }
.tile { box-shadow: 0 6px 18px rgba(0, 0, 0, .10); }
@media (max-width: 760px) {
  .hero { padding-top: 48px; }
}
/* Shared finishing details preserve each app's palette. */
.link { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); line-height: 1.4; }
.link-chevron { display: inline-block; width: 6px; height: 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); flex-shrink: 0; }
.button { line-height: 1.4; letter-spacing: -0.01em; }
.appearance-menu { padding: var(--space-1); }
.appearance-menu button { gap: var(--space-1); padding: 12px var(--space-1); }
.appearance-check { display: flex; align-items: center; justify-content: center; }
.appearance-check svg { width: 14px; height: 14px; }
.navigation-panel { padding: var(--space-1); }
@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .tile { box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }
}

:where(:root[data-theme="dark"]) .tile { box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }

@media (max-width: 760px) {
  section { padding-block: var(--space-8); }
  .card { padding: var(--space-4) var(--space-3); }
  .section-head { margin-bottom: var(--space-4); }
}

/* Final composition: quiet captions, deliberate headlines, aligned chrome. */
.card .badge, .card .badge-mine { font-size: 0.75rem; line-height: 1.4; letter-spacing: .01em; margin-top: 4px; }
.card h3 { max-width: 20ch; text-wrap: balance; }
.card .name { line-height: 1.3; }
.nav-name { line-height: 1.2; }
.nav-name .tile { flex-shrink: 0; }
.appearance-trigger svg, .navigation-toggle svg { width: 18px; height: 18px; stroke-width: 1.75; }
.nav-links { gap: 20px; }
.theme-portfolio .section-head { margin-bottom: var(--space-4); }
.theme-portfolio .hero { padding-bottom: var(--space-6); }
.theme-portfolio #work { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.theme-portfolio #about { text-align: center; padding-top: var(--space-6); padding-bottom: var(--space-4); }
.theme-portfolio .about h2 { margin-bottom: var(--space-3); text-wrap: balance; }
.theme-portfolio .about-copy { max-width: 60ch; margin-inline: auto; }
.theme-portfolio .about p { max-width: none; margin: 0; text-wrap: pretty; }
.theme-portfolio .about p + p { margin-top: var(--space-3); font-size: 1.0625rem; line-height: 1.6; }
.theme-portfolio #contact { --surface-border-color: var(--card); border: 1px solid var(--surface-border); max-width: 1032px; margin: var(--space-3) auto 40px; padding: var(--space-8) var(--space-3); background: var(--card); border-radius: var(--radius-card); }
.theme-portfolio .contact .lede { text-wrap: balance; }
@media (max-width: 760px) {
  .nav-links { gap: 8px; }
  .nav-inner { min-height: 56px; padding-block: 0; }
  .theme-portfolio .hero { padding-bottom: var(--space-4); }
  .theme-portfolio #work { padding-top: var(--space-4); }
  .theme-portfolio #about { padding-top: var(--space-4); padding-bottom: var(--space-3); }
  .theme-portfolio #contact { margin: var(--space-3) 20px 24px; padding: var(--space-6) var(--space-3); }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .theme-portfolio #contact { margin-inline: 24px; }
}

/* Shared states work with mouse, touch, and keyboard without sticky hover. */
.appearance-menu button, .navigation-panel a { transition: background-color 160ms ease; }
.appearance-menu button:active, .navigation-panel a:active { background: var(--card); }
.link:hover { text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .button:hover, .professional-pill:hover, .nav-links .pill:hover { filter: brightness(1.06); }
  .appearance-trigger:hover, .navigation-toggle:hover,
  .appearance-menu button:hover, .navigation-panel a:hover { background: var(--card); text-decoration: none; }
}
.appearance-trigger:focus-visible, .navigation-toggle:focus-visible { outline-offset: 4px; }
/* Primary at rest, secondary on hover, without changing the filled download action. */
.nav-links > a:not(.pill), .nav-links .appearance-trigger, .nav-links .navigation-toggle { color: var(--text); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .nav-links > a:not(.pill):hover, .nav-links .appearance-trigger:hover, .nav-links .navigation-toggle:hover { color: var(--text-2); background: transparent; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav, .appearance-menu, .navigation-panel { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .card, .nav, .appearance-menu, .navigation-panel, .footer { border-color: var(--text-2); }
  .nav-links a { opacity: 1; }
  .meta, .card .badge { color: var(--text); }
}

/* Stable mobile popovers and a deliberate footer stack. */
.footer { align-items: center; }
@media (max-width: 760px) {
  .footer { --footer-gutter: 20px; flex-direction: column; justify-content: center; text-align: center; gap: 8px; padding-block: 12px max(12px, env(safe-area-inset-bottom)); }
  .footer nav { justify-content: center; }
  .footer > p { order: 1; font-size: 0.75rem; }
  .appearance-menu, .navigation-panel { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Visual review: balanced phone headline and stable mobile action groups. */
.meta a { white-space: nowrap; }
@media (max-width: 760px) {
  .theme-portfolio .hero h1 { font-size: clamp(2rem, 10vw, 2.5rem); }
  .theme-reeve .hero .actions, .theme-dishfork .hero .actions { flex-direction: column; gap: var(--space-2); }
}


/* Shared app composition: readable copy beside the product, then a short feature story. */
.app-site section { padding-block: 56px; }
.app-site .hero { padding-block: 64px; }
/* Confine the app-color glow to the top; finish on the base surface before the next chapter. */
.app-site .hero-wrap { background: var(--field) top / 100% 520px no-repeat, var(--bg); }
.app-site { --features-surface: color-mix(in srgb, var(--bg) 93%, var(--text) 7%); }
.app-site .features-chapter { position: relative; background: var(--card); background: var(--features-surface); padding-block: 48px 24px; }
.app-site .hero-product { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; text-align: left; }
.app-site .hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); max-width: 18ch; margin: 0; text-wrap: balance; }
.app-site .hero .tile { margin: 0 0 24px; width: 72px; height: 72px; border-radius: 18px; }
.app-site .hero .lede { margin: 24px 0 0; max-width: 42ch; text-wrap: pretty; }
.app-site .hero .actions { justify-content: flex-start; align-items: center; flex-direction: row; }
.app-site .actions { flex-direction: row; gap: 20px; }
.app-site .actions > .link { min-height: 44px; }
.app-site .store-badge { margin: 12px; }
.app-site .hero .store-badge { margin-left: 0; }
.app-site .meta { font-size: 0.875rem; line-height: 1.6; }
.app-site .hero .device { margin: 0; justify-self: end; }
.app-site .device { width: min(300px, 78vw); }
/* Apple's unmodified iPhone 18 Pro PNG surrounds its matching 1206 × 2622 screen.
   Keep the full artwork visible; do not add shadows or crop the bezel. */
.app-site .device { position: relative; aspect-ratio: 1350 / 2760; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.app-site .device::after { content: ''; position: absolute; inset: 0; background: url('/icons/device-frames/iphone-18-pro-black.png') center / 100% 100% no-repeat; pointer-events: none; }
.app-site .device .device-screen { position: absolute; left: 5.333333%; top: 2.5%; width: 89.333333%; height: 95%; border-radius: 14% / 6.5%; }
.app-site .device-screen img { height: auto; object-fit: contain; }
.app-site .feature { gap: 56px; align-items: center; padding-block: 48px; }
.app-site .feature-copy { padding-top: 0; }
.app-site .feature .device { margin: 0; justify-self: start; }
.app-site .feature:not(.feature-flip) .device { justify-self: end; }
.app-site .feature-flip .feature-copy { text-align: right; }
.app-site .feature-flip :is(h2, p) { margin-left: auto; }
.app-site .feature h2 { max-width: 16ch; text-wrap: balance; }
.app-site .feature p { line-height: 1.6; text-wrap: pretty; }
.app-site .feature .eyebrow { color: var(--accent); color: color-mix(in srgb, var(--accent) 85%, var(--text) 15%); font-size: 1rem; }
.app-site .contact .link, .app-site .features-chapter a { color: color-mix(in srgb, var(--accent) 85%, var(--text) 15%); }
.app-site .feature + .feature { border-top: 0; }
.app-site .role { justify-content: flex-start; }
.app-site .contact { --surface-border-color: var(--features-surface); border: 1px solid var(--surface-border); margin-block: 40px; padding: 56px 24px; border-radius: 24px; background: var(--features-surface); max-width: 1032px; }
/* Flat light surfaces separate the hero, feature story, and closing invitation.
   Keep dark surfaces and the manual appearance picker on the existing palette. */
@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .app-site .hero-wrap { background: var(--field) top / 100% 100% no-repeat; }
:where(:root:not([data-theme])) .app-site { --features-surface: color-mix(in srgb, var(--bg) 97%, var(--text) 3%); }
}

:where(:root[data-theme="dark"]) .app-site .hero-wrap { background: var(--field) top / 100% 100% no-repeat; }
:where(:root[data-theme="dark"]) .app-site { --features-surface: color-mix(in srgb, var(--bg) 97%, var(--text) 3%); }

.app-site .about .meta { font-size: 0.875rem; margin-top: 24px; }
.app-site .footer { font-size: 0.875rem; }
@media (max-width: 900px) {
  .app-site .hero-product { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .app-site .hero .device, .app-site .feature .device { margin-inline: auto; justify-self: center; }
  .app-site .feature:not(.feature-flip) .device { justify-self: center; }
  .app-site .feature-flip .feature-copy { text-align: center; }
  .app-site .hero h1, .app-site .hero .tile { margin-inline: auto; }
  .app-site .hero .lede { margin-inline: auto; }
  .app-site .hero .actions { justify-content: center; align-items: center; }
  .app-site .hero .store-badge { margin-left: 12px; }
  .app-site .role { justify-content: center; }
  .app-site .feature { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .app-site .feature-copy { padding-top: 0; }
  .app-site .feature-flip .feature-copy { order: 0; }
  .app-site .feature h2, .app-site .feature p { margin-inline: auto; }
  .app-site .contact { margin-inline: 20px; }
}
@media (max-width: 760px) {
  .app-site section, .app-site .hero { padding-block: 48px; }
  .app-site .features-chapter { padding-block: 40px 8px; }
  .app-site .hero h1 { font-size: clamp(2.25rem, 10vw, 3.25rem); }
  .app-site .hero .actions { flex-direction: column; gap: 8px; }
  .app-site .contact { margin-block: 24px; }
}

/* Beta actions match the 48px download badge height with site-native styling. */
.app-site .testflight-button { min-height: 48px; padding: 12px 24px; font-size: 1rem; line-height: 24px; }

/* Audit refinements: readable documents and clear link and navigation affordances. */
.document-copy p + p, .document-copy ul + p { margin-top: 16px; }
.document-copy :where(p, li) a, .about p a { text-decoration: underline; text-underline-offset: .18em; }
.actions > .link { min-height: 44px; }
.meta, .footer { font-size: 0.875rem; }
.footer .trademark-credit { flex-basis: 100%; font-size: 0.75rem; line-height: 1.6; }
.nav-links a { opacity: 1; }
.nav-links a[aria-current="page"], .footer a[aria-current="page"], .navigation-panel a[aria-current="page"] { text-decoration: underline; text-underline-offset: .25em; font-weight: 600; }
/* Keep generic placeholder frames without simulated Apple hardware details. */
.device-screen::before { display: none; }
@media (orientation: landscape) {
  .footer { --footer-gutter: max(24px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .nav-inner { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  section, .document-copy { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
}

/* App pages retain one navigation bar that detaches after its original position. */
html:has(.app-site) { scroll-padding-top: 92px; }
.app-site .nav { transition: background-color 220ms ease, border-color 220ms ease; }
/* Match section gutters inside the 12px floating inset, accounting for its 1px border.
   Keep the same geometry in both states so controls never shift sideways. */
.app-site .nav-inner { width: calc(100% - 24px); max-width: 1056px; padding-inline: 11px; border: 1px solid transparent; transform: translateY(0); transition: transform 220ms ease, border-radius 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease; }
/* Compact visible pills retain a 44px target through their existing hit-area extension. */
.app-site .nav-links > .pill { min-height: 32px; line-height: 20px; padding: 4px 10px; }
.app-site .nav-links { gap: 8px; }
.app-site .nav-floating { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.app-site .nav-floating .nav-inner {
  --floating-surface: color-mix(in srgb, var(--bg) 84%, var(--text) 6%);
  --surface-border-color: var(--floating-surface);
  transform: translateY(8px);
  border: 1px solid var(--surface-border); border-radius: 24px;
  background: var(--floating-surface);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
}
@media (max-width: 760px) {
  .app-site .nav-ready .nav-links > .pill { display: inline-flex; min-height: 32px; margin-block: 6px; padding: 4px 10px; }
  /* Extend the hit area without increasing the visible pill height. */
  .app-site .nav-ready .nav-links > .pill::before { display: block; inset: -6px 0; }
  .app-site .nav-links { gap: 4px; }
  .app-site .nav-inner { gap: 8px; flex-wrap: nowrap; }
  .app-site .nav-name { font-size: 0.9375rem; gap: 6px; min-width: 0; }
  .app-site .nav-name .tile { width: 20px; height: 20px; }
  .app-site .nav-links .pill { font-size: 0.75rem; }
  .app-site .nav-inner { padding-left: max(7px, calc(env(safe-area-inset-left) - 13px)); padding-right: max(7px, calc(env(safe-area-inset-right) - 13px)); }
}
@media (prefers-reduced-motion: reduce) { .app-site .nav, .app-site .nav-inner { transition: none; } }
@media (prefers-reduced-transparency: reduce) { .app-site .nav-floating .nav-inner { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-contrast: more) { .app-site .nav-floating .nav-inner { border-color: var(--text-2); } }
@media (max-height: 400px) { .app-site .nav { position: relative; } .app-site .nav-floating .nav-inner { transform: none; } }

/* One quiet ownership and navigation row, with natural wrapping on small screens. */
.app-footer { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; text-align: left; padding-block: 16px; gap: 8px 32px; font-size: 0.875rem; line-height: 1.6; }
.app-footer p { margin: 0; }
.app-footer nav { justify-content: flex-start; gap: 4px 24px; }
.app-footer .footer-attribution { display: inline; }
/* A brief privacy reassurance leads into the full-width closing invitation. */
.app-site .privacy-summary { padding-block: 32px; }
.app-site .privacy-summary h2 { margin-bottom: 16px; }
@media (max-width: 760px) { .app-site .privacy-summary { padding-block: 24px; } }
@media (max-width: 760px) {
  .app-footer { flex-direction: column; align-items: stretch; gap: 8px; padding-block: 12px max(12px, env(safe-area-inset-bottom)); }
  .app-footer nav { display: flex; justify-content: center; flex-wrap: wrap; align-self: center; max-width: min(100%, 300px); gap: 0 24px; }
  /* Four links form two centered pairs rather than a row with one orphan. */
  .app-footer nav:has(> a:nth-child(4)):not(:has(> a:nth-child(5))) { max-width: min(100%, 220px); }
  .app-footer nav a { justify-content: center; text-align: center; padding-inline: 8px; }
  .app-footer > p { text-align: center; }
}

/* Group the portfolio appearance control with Contact without tightening text navigation. */
@media (min-width: 761px) {
  .theme-portfolio .nav-links > .appearance { margin-inline: -12px; }
}

/* Secondary professional links follow the selected appearance with official brand artwork. */
.theme-portfolio .professional-links { margin-top: 24px; gap: 12px; }
.professional-pill {
  --professional-surface: var(--card);
  --professional-foreground: var(--text);
  --surface-border-color: var(--professional-surface);
  --surface-border-contrast: var(--professional-foreground);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 980px;
  border: 1px solid var(--surface-border); background: var(--professional-surface); color: var(--professional-foreground);
  font-size: 0.875rem; font-weight: 600; line-height: 1.2;
}
.professional-pill img, .professional-pill svg { display: block; flex-shrink: 0; }
.professional-pill picture { display: flex; align-items: center; justify-content: center; }
.professional-pill .linkedin-wordmark { width: 81px; height: auto; }
.professional-pill .github-lockup { width: 88px; height: auto; }
.professional-pill .resume-label { font-size: 1.125rem; font-weight: 600; }
.professional-pill .file-label { padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--professional-foreground) 10%, var(--professional-surface)); color: var(--professional-foreground); font-size: 0.625rem; font-weight: 500; line-height: 16px; }
.professional-pill:hover { --professional-surface: color-mix(in srgb, var(--card) 94%, var(--text)); text-decoration: none; }
.professional-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-contrast: more) {
  .theme-portfolio #contact, .app-site .contact { border-color: var(--text-2); }
}

/* Filled-control variant: retain the preferred Explore edge across primary actions. */
.button, .nav-links > .pill {
  --surface-border-color: var(--button);
  --surface-border-contrast: var(--on-button);
  --surface-border: var(--border-filled);
  border: 1px solid var(--surface-border);
}
.button { padding: 11px 23px; }
.app-site .testflight-button { padding: 11px 23px; }
.nav-links > .pill { padding: 4px 11px; }
.app-site .nav-links > .pill, .app-site .nav-ready .nav-links > .pill { padding: 3px 9px; }
@media (prefers-contrast: more) {
  .button, .nav-links > .pill { border-color: var(--on-button); }
  .professional-pill { border-color: var(--professional-foreground); }
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.not-found { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.not-found .actions { margin-top: 0; justify-content: flex-start; }
.brand-label { display: none; }
@media (forced-colors: active) {
  .professional-pill picture { display: none; }
  .professional-pill .brand-label { display: inline; font-size: 1.125rem; font-weight: 600; }
}
