/* Home and the DishFork page use DishFork's palette (dishfork.com) */
:root {
  --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: "SF Pro Rounded", ui-rounded, -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 {
    --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%);
  }
}

/* Reeve page uses Reeve's palette (reevemoney.com) */
.theme-reeve {
  --bg: #F2F7F8;
  --card: #FFFFFF;
  --text: #0B2530;
  --text-2: #55747D;
  --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) {
  .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: #FBF6EC;
  --card: #FFFFFF;
  --text: #2A0E10;
  --text-2: #7A5A50;
  --hairline: rgba(42, 14, 16, 0.09);
  --nav-bg: rgba(251, 246, 236, 0.74);
  --device: #1E0709;
  --accent: #A3161F;
  --button: #A3161F;
  --on-button: #FFFFFF;
  --glow: rgba(193, 39, 45, 0.18);
  --field: radial-gradient(560px 520px at 10% -4%, rgba(193, 39, 45, 0.18), transparent 70%),
    radial-gradient(520px 480px at 92% 2%, rgba(240, 199, 94, 0.26), transparent 70%),
    linear-gradient(#F6E8D6, #FBF6EC 62%);
}

@media (prefers-color-scheme: dark) {
  .theme-renfo {
    --bg: #1A0608;
    --card: #2A0C0F;
    --text: #FBEFE0;
    --text-2: #C29A88;
    --hairline: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(26, 6, 8, 0.74);
    --device: #0D0304;
    --accent: #F0C75E;
    --button: #F0C75E;
    --on-button: #2A0E10;
    --glow: rgba(193, 39, 45, 0.42);
    --field: radial-gradient(560px 520px at 10% -4%, rgba(193, 39, 45, 0.48), transparent 70%),
      radial-gradient(520px 480px at 92% 2%, rgba(217, 138, 53, 0.20), transparent 70%),
      linear-gradient(#3A0C10, #1A0608 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) {
  .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: #23845C; --button: #23845C; --on-button: #FFFFFF; --glow: rgba(35, 132, 92, 0.18); }
.accent-iwatch    { --accent: #C2185B; --button: #C2185B; --on-button: #FFFFFF; --glow: rgba(194, 24, 91, 0.16); }

@media (prefers-color-scheme: dark) {
  .accent-reeve     { --accent: #2FE0E6; --button: #2FE0E6; --on-button: #011C24; --glow: rgba(10, 176, 192, 0.38); }
  .accent-dishfork  { --accent: #DE7A57; --button: #B6492E; --on-button: #FFFFFF; --glow: rgba(182, 73, 46, 0.35); }
  .accent-renfo     { --accent: #E6C35C; --button: #E6C35C; --on-button: #2A1F02; --glow: rgba(140, 47, 57, 0.45); }
  .accent-homestead { --accent: #5FD6A0; --button: #5FD6A0; --on-button: #032417; --glow: rgba(35, 132, 92, 0.40); }
  .accent-iwatch    { --accent: #FF6FA5; --button: #FF6FA5; --on-button: #2A0414; --glow: rgba(194, 24, 91, 0.38); }
}

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

html { scroll-behavior: smooth; }

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

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

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

h1 { font-size: clamp(44px, 7.5vw, 88px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 700; }
h3 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 700; }

section { padding: 128px 24px; max-width: 1080px; margin: 0 auto; }

.eyebrow { color: var(--accent); font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.lede { color: var(--text-2); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.4; max-width: 640px; }
.meta { color: var(--text-2); font-size: 12px; margin-top: 24px; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .lede { margin: 16px auto 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 52px;
  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: 17px; font-weight: 600; }
.nav-name:hover { text-decoration: none; }
.nav-name .tile { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; box-shadow: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text); font-size: 13px; 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; }

/* 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; }
.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(22px, 2.8vw, 30px); 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; }

.button {
  display: inline-block; background: var(--button); color: var(--on-button);
  font-size: 17px; font-weight: 500; padding: 12px 22px; border-radius: 12px;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.link { font-size: 17px; 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: auto; }

/* 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: 34px; 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: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; }
.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: #3fbf86; --tile-b: #1a6b4a; }
.tile-iwatch    { --tile-a: #ff5c93; --tile-b: #8e0f42; }

/* Landing: project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 28px; padding: 48px 36px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card .tile { margin-bottom: 20px; }
.card .name { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.card .badge {
  margin: 8px 0 20px; padding: 4px 10px; border-radius: 980px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2); border: 1px solid var(--hairline);
}
.card .badge-mine { color: var(--accent); border-color: currentColor; }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-2); font-size: 15px; max-width: 340px; }
.card .actions { margin-top: auto; padding-top: 28px; gap: 18px; }
.card .actions .link { font-size: 14px; }

/* 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: 19px; 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: 14px; 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 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-placeholder { color: var(--text-2); font-size: 14px; }

/* About + contact */
.about { text-align: center; }
.about h2 { margin-bottom: 24px; }
.about p { font-size: clamp(19px, 2.2vw, 22px); 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);
  max-width: 1080px; margin: 0 auto; padding: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-2); font-size: 12px;
}
.footer a { color: var(--text-2); }

/* Development helper from theme-toggle.js; delete with it */
.theme-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  display: flex; gap: 2px; padding: 3px; border-radius: 980px; border: 1px solid var(--hairline);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.theme-toggle button {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 28px; border: 0; border-radius: 980px;
  background: none; color: var(--text-2); cursor: pointer;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-checked="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

@media (max-width: 760px) {
  section { padding: 96px 20px; }
  .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: 16px; }
  .nav-links .hide-sm { display: none; }
}
