/* ==========================================================================
   barkley.css — Barkley's own app. Deliberately its own look: dark, high
   contrast, big tap targets, because the first job of the home page is to
   be read by a stranger holding a lost dog at dusk.
   Hand-written; no framework, no CDN, no web fonts.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }

/* An attribute height makes the height definite and disables CSS
   aspect-ratio, which lets object-fit crop the photo. See site.css. */
img { height: auto; }

/* Author display rules override the browser's [hidden] { display: none }, so
   restate it or the hidden attribute silently stops working. */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:root {
  --bg:        #161d2b;
  --bg-2:      #1e2739;
  --panel:     #26314a;
  --panel-2:   #2f3c59;
  --line:      rgba(255,255,255,.10);
  --indigo:    #7f8fe8;
  --indigo-hi: #9aa8f2;
  --gold:      #ffd166;
  --text:      #e6ecf7;
  --muted:     #a6b3ca;
  --radius:    18px;
  --topbar-h:  3.5rem;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  min-height: 100svh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(58,72,110,.55) 0%, transparent 70%),
    linear-gradient(180deg, #1b2436 0%, var(--bg) 45%, #131a26 100%);
  background-attachment: fixed;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  overflow-x: hidden;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------------- top bar -- */
.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) .75rem 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: linear-gradient(180deg, #2b3752, #202a3e);
  border-bottom: 1px solid var(--line);
}
.bar__brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: 1.05rem;
  color: var(--gold);
}
.bar__spacer { flex: 1; }

.iconbtn {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--indigo);
  cursor: pointer;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.iconbtn:hover { background: rgba(255,255,255,.08); }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 1.6rem; height: 1.6rem; }

.installpill {
  height: 2.3rem;
  display: none;
  align-items: center;
  gap: .5rem;
  padding: 0 1rem;
  border: 0; border-radius: 999px;
  background: var(--gold);
  color: #23304a;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.installpill.is-visible { display: inline-flex; }

/* ---------------------------------------------------------------- menu -- */
.menu {
  position: fixed;
  top: 0; right: 0;
  z-index: 100;
  height: 100svh;
  width: min(17rem, 82vw);
  padding: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 1rem) 1rem 1.5rem;
  background: linear-gradient(180deg, #29344d, #1a2233);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 40px rgba(0,0,0,.45);
  transform: translateX(102%);
  transition: transform 300ms var(--ease);
  overflow-y: auto;
}
.menu[data-open="true"] { transform: translateX(0); }
.menu a {
  display: block;
  padding: .85rem .9rem;
  border-radius: 12px;
  font-size: 1.05rem;
  transition: background 160ms var(--ease);
}
.menu a:hover, .menu a[aria-current="page"] { background: rgba(127,143,232,.22); }
.menu a[aria-current="page"] { color: var(--gold); font-weight: 700; }

.scrim {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(6,10,18,.6);
  opacity: 0; visibility: hidden;
  transition: opacity 260ms var(--ease), visibility 260ms;
}
.scrim[data-open="true"] { opacity: 1; visibility: visible; }

/* -------------------------------------------------------------- layout -- */
.wrap {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.wrap--wide { max-width: 68rem; }

.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  background: linear-gradient(140deg, #34307e 0%, #221f4d 100%);
  border-bottom: 4px solid var(--indigo);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--gold);
}
.hero p { color: #c3ccf3; font-style: italic; margin-top: .4rem; }
/* Rounded square, not a circle: the photo is framed tight on Barkley's face
   and a circular mask cuts his ears and chin off. */
.hero img {
  width: clamp(9rem, 40vw, 14rem);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20%;
  border: 4px solid var(--gold);
  margin: 0 auto 1.25rem;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}

/* ------------------------------------------------------------- ID card -- */
.idcard {
  background: var(--bg-2);
  border: 2px solid rgba(127,143,232,.32);
  border-radius: 26px;
  padding: 1.5rem 1.25rem 1.75rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.idcard__name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--indigo-hi);
}
.idcard__name span { color: var(--gold); }
.idcard__sub { color: var(--muted); font-style: italic; margin-top: .3rem; }
.idcard__photo {
  width: clamp(11rem, 52vw, 17rem);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20%;
  border: 4px solid var(--gold);
  margin: 1.4rem auto;
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
}

.plea {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.45;
  margin-bottom: 1.1rem;
}

/* Big, unmissable call targets. */
.calls { display: grid; gap: .6rem; }
.call {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.call:hover { background: var(--panel-2); transform: translateY(-1px); }
.call__icon {
  flex: 0 0 auto;
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(127,143,232,.2);
  color: var(--indigo-hi);
}
.call__icon svg { width: 1.2rem; height: 1.2rem; }
.call__who { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.call__num { font-size: 1.15rem; font-weight: 700; color: var(--indigo-hi); }

.addr {
  display: block;
  margin-top: .9rem;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: .95rem;
  color: var(--indigo-hi);
  transition: color 160ms var(--ease);
}
.addr:hover { color: var(--gold); }
.addr small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .3rem; }

.signoff { margin-top: 1.25rem; color: #c3ccf3; font-weight: 600; }

/* -------------------------------------------------------------- panels -- */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.panel + .panel { margin-top: 1rem; }

h2.sect {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--indigo-hi);
  margin: 2.25rem 0 .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(127,143,232,.28);
}
h3.sub {
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .8rem;
  text-align: center;
}
.prose { font-size: 1.02rem; line-height: 1.7; color: #dbe3f2; }
.prose p + p { margin-top: 1rem; }
.pull { color: var(--gold); font-style: italic; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem,1fr)); gap: .7rem; text-align: center; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem .6rem;
}
.tile span { font-size: 2rem; line-height: 1; }
.tile p { margin-top: .5rem; font-weight: 700; color: var(--indigo-hi); font-size: .9rem; }

/* border-collapse: collapse would defeat the rounded corners, so the cells
   keep their own borders and border-spacing does the tightening. */
table.skills {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
}
table.skills thead { background: #2b2f66; }
table.skills th {
  text-align: left;
  padding: .85rem 1rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
table.skills th:last-child, table.skills td:last-child { text-align: right; }
table.skills td { padding: .85rem 1rem; font-size: .92rem; border-top: 1px solid var(--line); background: var(--bg-2); }
table.skills td:first-child { font-weight: 700; }
.lvl-a { color: #7fd18c; } .lvl-b { color: var(--indigo-hi); }
.lvl-c { color: #f0c05a; } .lvl-d { color: #f08a8a; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: #4f5bd5;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.btn:hover { background: #626ee6; transform: translateY(-1px); }

.factbox { text-align: center; }
.factbox p { font-size: 1.15rem; font-style: italic; min-height: 3.4rem; display: grid; place-items: center; }

/* ------------------------------------------------------------- gallery -- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: .9rem;
}
.grid button {
  position: relative;
  padding: .4rem;
  border: 1px solid rgba(127,143,232,.22);
  border-radius: 16px;
  background: var(--bg-2);
  cursor: pointer;
  overflow: hidden;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
}
.grid button:hover { transform: translateY(-3px); border-color: var(--indigo); }
.grid img, .grid video {
  width: 100%;
  height: 13rem;
  object-fit: cover;
  border-radius: 12px;
  background: #0f1520;
}
.grid .badge {
  position: absolute;
  top: .8rem; left: .8rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(10,14,24,.75);
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

.lightbox {
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center;
  padding: 1.25rem;
  background: rgba(6,9,16,.95);
  opacity: 0; visibility: hidden;
  transition: opacity 220ms var(--ease), visibility 220ms;
}
.lightbox[data-open="true"] { opacity: 1; visibility: visible; }
.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 76svh;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.lightbox figcaption {
  margin-top: .9rem;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}
.lb-btn {
  position: absolute;
  width: 3rem; height: 3rem;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.4rem;
  display: grid; place-items: center;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-x    { top: 1rem; right: 1rem; }
.lb-prev { left: .6rem;  top: 50%; margin-top: -1.5rem; }
.lb-next { right: .6rem; top: 50%; margin-top: -1.5rem; }

/* ------------------------------------------------- iOS install coaching -- */
.iossheet {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 170%);
  width: min(23rem, calc(100vw - 1.5rem));
  z-index: 110;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 18px;
  background: #f7f9ff;
  color: #23304a;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transition: transform 420ms var(--ease);
}
.iossheet[data-open="true"] { transform: translate(-50%, 0); }
.iossheet h2 { font-size: 1.05rem; margin-bottom: .4rem; }
.iossheet p { font-size: .86rem; line-height: 1.6; }
.iossheet ol { list-style: decimal; padding-left: 1.15rem; margin-top: .7rem; font-size: .86rem; line-height: 1.75; }
.iossheet__close {
  position: absolute; top: .5rem; right: .5rem;
  width: 2rem; height: 2rem;
  border: 0; border-radius: 50%;
  background: rgba(35,48,74,.1);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}

.toast {
  position: fixed; left: 50%; bottom: 1rem;
  transform: translate(-50%, 200%);
  z-index: 120;
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .7rem .7rem 1.1rem;
  border-radius: 999px;
  background: #2f3c59;
  color: var(--text);
  font-size: .86rem;
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  transition: transform 380ms var(--ease);
}
.toast[data-open="true"] { transform: translate(-50%, 0); }
.toast button {
  border: 0; border-radius: 999px;
  padding: .4rem .9rem;
  background: var(--gold);
  color: #23304a;
  font-weight: 700;
  cursor: pointer;
}

.foot { text-align: center; padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom,0px)); color: #7f8ca6; font-size: .8rem; }

.skiplink {
  position: absolute; top: -4rem; left: .5rem; z-index: 200;
  padding: .6rem 1rem; background: var(--gold); color: #23304a; border-radius: 0 0 10px 10px;
  transition: top 180ms var(--ease);
}
.skiplink:focus { top: 0; }
