/* =================================================================
   Leonardo Baptiste — personal site
   -----------------------------------------------------------------
   The palette below is lifted from the Vendor app's own theme
   (Vendor/Views/VendorTheme.swift) on purpose, so the website and
   the app read as one product. If the app's brand colour changes,
   change it here too.
   ================================================================= */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -----------------------------------------------------------------
   TOKENS — light is the base; dark redefines only what changes.
   ----------------------------------------------------------------- */
:root {
  --canvas:    #F2F2F7;
  --surface:   #FFFFFF;
  --surface-2: #FAFAFC;
  --hairline:  #E3E3EB;
  --ink:       #1B1B2F;
  --ink-2:     #63637A;
  --ink-3:     #8A8A99;

  --brand:      #6C5CE7;
  --brand-deep: #5B4CE0;
  --brand-soft: #EDEAFD;
  --brand-ink:  #FFFFFF;

  --warn:      #B45309;
  --warn-soft: #FEF3E2;
  --ok:        #16A34A;

  --shadow-sm: 0 1px 2px rgba(27, 27, 47, .05);
  --shadow-md: 0 4px 16px rgba(27, 27, 47, .07);
  --shadow-lg: 0 12px 40px rgba(27, 27, 47, .10);
  --ring: 0 0 0 3px rgba(108, 92, 231, .28);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1000px;
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --canvas:    #0D0D12;
    --surface:   #16161D;
    --surface-2: #1A1A22;
    --hairline:  #2A2A34;
    --ink:       #F5F5FA;
    --ink-2:     #A6A6B8;
    --ink-3:     #82828F;

    --brand:      #8B7CF6;
    --brand-deep: #7C6BF2;
    --brand-soft: #241F3A;
    --brand-ink:  #12101C;

    --warn:      #FBBF24;
    --warn-soft: #2B2313;
    --ok:        #4ADE80;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .40);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .50);
    --ring: 0 0 0 3px rgba(139, 124, 246, .35);
  }
}

:root[data-scheme="dark"] {
  --canvas:    #0D0D12;
  --surface:   #16161D;
  --surface-2: #1A1A22;
  --hairline:  #2A2A34;
  --ink:       #F5F5FA;
  --ink-2:     #A6A6B8;
  --ink-3:     #82828F;

  --brand:      #8B7CF6;
  --brand-deep: #7C6BF2;
  --brand-soft: #241F3A;
  --brand-ink:  #12101C;

  --warn:      #FBBF24;
  --warn-soft: #2B2313;
  --ok:        #4ADE80;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .40);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .50);
  --ring: 0 0 0 3px rgba(139, 124, 246, .35);
}

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

/* Author `display` rules outrank the UA stylesheet, so [hidden] needs to
   win explicitly — otherwise a hidden flex/grid element still shows. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

p { margin: 0; }

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

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

b { font-weight: 600; color: var(--ink); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.skip:focus { left: 16px; }

/* -----------------------------------------------------------------
   TOP BAR
   ----------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-stuck { border-bottom-color: var(--hairline); }

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-right: auto;
  white-space: nowrap;
}
.brandmark:hover { text-decoration: none; opacity: .8; }
.brandmark img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.topnav {
  display: flex;
  gap: 4px;
  /* Narrow phones can't fit four labels: let them scroll sideways rather
     than wrap, which would double the height of a fixed-height bar. */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.topnav a:hover {
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}
.topnav a.is-current {
  color: var(--brand);
  background: var(--brand-soft);
}

.scheme {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.scheme:hover { color: var(--ink); border-color: var(--ink-3); }
.scheme svg { width: 17px; height: 17px; }

/* On touch screens the 36px circle is under Apple's 44pt minimum, so grow
   the hit area without changing how the button looks. */
@media (pointer: coarse) {
  .scheme { position: relative; }
  .scheme::after {
    content: "";
    position: absolute;
    inset: -5px;
  }
}

/* One icon at a time: sun in dark mode (tap to go light), moon in light. */
.scheme__sun { display: none; }
.scheme__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .scheme__sun { display: block; }
  :root:not([data-scheme="light"]) .scheme__moon { display: none; }
}
:root[data-scheme="dark"] .scheme__sun { display: block; }
:root[data-scheme="dark"] .scheme__moon { display: none; }
:root[data-scheme="light"] .scheme__sun { display: none; }
:root[data-scheme="light"] .scheme__moon { display: block; }

/* -----------------------------------------------------------------
   HERO
   ----------------------------------------------------------------- */
.hero {
  position: relative;
  /* Deliberately short: the first app card should be reachable without
     the visitor having to guess there's anything below the fold. */
  padding: 44px 0 40px;
  overflow: hidden;
}

/* A single soft brand wash behind the hero — the only decoration on
   the page. Deliberately quiet. */
.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120vw);
  height: 560px;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--brand) 22%, transparent),
    transparent 68%
  );
  opacity: .5;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-lg);
}

.hero__name {
  margin-top: 16px;
  font-size: clamp(28px, 5.4vw, 40px);
  letter-spacing: -0.03em;
}

.hero__role {
  margin-top: 6px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero__bio {
  margin-top: 14px;
  max-width: 54ch;
  color: var(--ink-2);
  font-size: 16px;
}

.hero__cta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.trust {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}
.trust li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
}
.trust svg { width: 15px; height: 15px; flex: none; }

/* -----------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease,
              border-color .15s ease, background-color .15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink-3);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn--primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

/* -----------------------------------------------------------------
   BANDS & SECTION HEADS
   ----------------------------------------------------------------- */
.band {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}
.band--alt { background: var(--surface-2); }

.sechead { margin-bottom: 24px; }
.sechead h2 {
  font-size: clamp(24px, 4vw, 30px);
  letter-spacing: -0.025em;
}
.sechead p {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 16px;
}

/* -----------------------------------------------------------------
   APP CARDS
   ----------------------------------------------------------------- */
/* Two fixed columns rather than auto-fit: the full-width lead card forces
   the track count, so auto-fit would leave a dead third column beside the
   two cards below it. */
.apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 760px) {
  .apps { grid-template-columns: 1fr 1fr; }
}

.app {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.app:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--hairline));
}

/* The flagship app spans the full row on wide screens. */
.app--lead { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .app--lead {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "head cta"
      "desc cta"
      "note note";
    align-items: start;
    column-gap: 32px;
  }
  .app--lead .app__head { grid-area: head; }
  .app--lead .app__desc { grid-area: desc; max-width: 62ch; }
  .app--lead .app__cta {
    grid-area: cta;
    flex-direction: column;
    margin-top: 4px;
    min-width: 170px;
  }
  .app--lead .app__cta .btn { width: 100%; }
  .app--lead .app__note { grid-area: note; }
}

.app__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.app__icon {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}
.app__icon--placeholder {
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px dashed color-mix(in srgb, var(--brand) 40%, transparent);
  box-shadow: none;
}
.app__icon--placeholder svg { width: 28px; height: 28px; }

.app__id { min-width: 0; }
.app__id h3 { font-size: 21px; }

.app__tag {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.app__meta {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.chip--brand {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand);
}
.chip--beta {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}
.chip--wip {
  background: transparent;
  border-style: dashed;
  color: var(--ink-3);
}

.app__desc {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15px;
}

.app__cta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app__note {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.55;
}
.app__note--warn { color: var(--warn); }
.app__note--warn b { color: inherit; }

.app--wip { background: transparent; box-shadow: none; }
.app--wip:hover { transform: none; }

/* -----------------------------------------------------------------
   REPOSITORIES
   ----------------------------------------------------------------- */
.repos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.repo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 17px 19px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.repo:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--hairline));
  box-shadow: var(--shadow-md);
}

.repo__name {
  color: var(--brand);
  font-size: 16px;
  font-weight: 600;
}
.repo__desc {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}
.repo__meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
}
.repo__sep { opacity: .5; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.dot--swift { background: #F05138; }

.repos__all {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
}

/* -----------------------------------------------------------------
   GUIDE STEPS
   ----------------------------------------------------------------- */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  counter-reset: none;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
}
.step:last-child { border-bottom: none; }

.step__n {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step__body h3 { font-size: 17px; }
.step__body p {
  margin-top: 7px;
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 15px;
}

.guide__help {
  margin-top: 30px;
  padding: 16px 20px;
  background: var(--brand-soft);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 14.5px;
}

/* -----------------------------------------------------------------
   CONTACT LINKS
   ----------------------------------------------------------------- */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.clink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.clink:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--c, var(--brand)) 45%, var(--hairline));
}
.clink--lead { grid-column: 1 / -1; }

.clink__icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.clink__icon svg { width: 21px; height: 21px; }

/* Brand colours live here, not in a style="" attribute: the page's
   Content-Security-Policy forbids inline styles outright. */
.clink__icon--tg { --c: #229ED9; }
.clink__icon--gh { --c: #6C5CE7; }
.clink__icon--rd { --c: #FF4500; }
.clink__icon--ink {
  --c: var(--ink);
  background: var(--canvas);
  color: var(--ink);
}

.clink__body { min-width: 0; margin-right: auto; }
.clink__title {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.clink__sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.clink__arrow {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--ink-3);
  transition: transform .15s ease;
}
.clink:hover .clink__arrow { transform: translateX(3px); }

/* -----------------------------------------------------------------
   FOOTER
   ----------------------------------------------------------------- */
.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--hairline);
}
.footer__inner { text-align: center; }
.footer__line {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.footer__note {
  margin-top: 8px;
  max-width: 60ch;
  margin-inline: auto;
  color: var(--ink-3);
  font-size: 13px;
}

/* -----------------------------------------------------------------
   404 PAGE
   Lives here rather than in a <style> block inside 404.html, so that
   page can run under the same no-inline-styles CSP as the home page.
   ----------------------------------------------------------------- */
.err {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.err__code {
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.err__title {
  margin-top: 12px;
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: -0.03em;
}
.err__msg {
  margin-top: 12px;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 16px;
}
.err__cta {
  margin-top: 26px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* -----------------------------------------------------------------
   REVEAL ON SCROLL — subtle, and skipped entirely when the visitor
   asked for reduced motion.
   ----------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* -----------------------------------------------------------------
   NARROW SCREENS
   ----------------------------------------------------------------- */
@media (max-width: 720px) {
  .wrap { padding-inline: 18px; }

  .brandmark span { display: none; }

  .topnav { gap: 0; margin-right: auto; }
  .topnav a { padding: 7px 9px; font-size: 13.5px; }

  .hero { padding: 48px 0 44px; }
  .hero__bio { font-size: 16px; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 auto; }

  .band { padding: 52px 0; }
  .apps, .repos, .links { grid-template-columns: 1fr; }
  .app { padding: 22px; }
  .app__cta .btn { flex: 1 1 auto; }
  .step { gap: 14px; }
}

@media (max-width: 400px) {
  .topnav a { padding: 7px 7px; font-size: 13px; }
}
