/* ==========================================================================
   Josh Beira — portfolio
   Ported from the Claude Design canvas "Josh Beira - Portfolio v2.dc.html".
   Every value here is taken from that design; the only additions are the
   focus, skip-link and scroll-margin rules the canvas format had no slot for.
   ========================================================================== */

:root {
  /* ground + rules */
  --bg:          #100F0E;
  --bg-elev:     #171615;
  --rule-soft:   #1C1B19;
  --rule:        #201F1C;
  --border:      #2C2A26;
  --sep:         #35322D;
  --dot-dim:     #3A3833;

  /* ink */
  /* The design's #7A756B measured 4.18:1 on the ground — under the 4.5:1 AA
     floor for the small mono meta text this drives. Nudged to 5.16:1. */
  --faint:       #8A8478;
  --muted:       #918B80;
  --ink-dim:     #DAD5C9;
  --ink:         #E9E4D9;
  --ink-bright:  #F2EEE4;

  --accent:      #7ED9C4;

  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 32px);
  --measure: 960px;
  --header-h: 48px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, p { margin: 0; }

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }

/* --- focus + skip link (not in the design; the design defines no focus state) */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  transition: top 140ms ease;
}
.skip:focus { top: 12px; }

/* --- stage ---------------------------------------------------------------- */

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page { position: relative; z-index: 1; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 20px;
  padding: 2px var(--gutter);
  background: rgba(16, 15, 14, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 14px 0;
  color: var(--ink);
}
.brand__name { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.brand__role { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(14px, 3.4vw, 24px);
  font-family: var(--mono);
  font-size: 11.5px;
}
.nav a { padding: 14px 2px; color: var(--muted); }
.nav a:hover { color: var(--ink); }

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

.hero {
  min-height: calc(100svh - var(--header-h));
  padding: clamp(56px, 11vw, 96px) 0 clamp(48px, 9vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero__inner { width: 100%; max-width: 660px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-bottom: 26px;
}
.hero__pulse { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hero__sep { color: var(--sep); }

.hero__name {
  font-size: clamp(40px, 10.5vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 500;
  color: var(--ink-bright);
}

.hero__lead {
  margin: 24px auto 0;
  max-width: 34ch;
  font-size: clamp(17px, 4.6vw, 20px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink-dim);
  text-wrap: pretty;
}

.hero__body {
  margin: 20px auto 0;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- section scaffolding -------------------------------------------------- */

.section { padding: clamp(60px, 10vw, 88px) 0 0; }
.section--contact { padding-bottom: clamp(72px, 12vw, 104px); }

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px;
}
.section__head--tight { margin-bottom: 12px; }
.section__head--wide  { margin-bottom: 36px; }

.section__head h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--ink-dim);
}
.section__rule { flex: 1; height: 1px; background: var(--rule); }
.section__count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.section__note {
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.list-end { border-top: 1px solid var(--rule-soft); }

/* --- selected work -------------------------------------------------------- */

.work-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: flex-start;
  padding: 26px 12px 26px 0;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink);
  transition: background 160ms ease, padding 160ms ease;
}
.work-row:hover { background: var(--bg-elev); padding-left: 12px; }

.work-row__num {
  flex: 0 0 22px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding-top: 5px;
}

.work-row__main { flex: 1 1 260px; min-width: 0; }

.work-row__title {
  font-size: clamp(17px, 4.4vw, 19px);
  letter-spacing: -0.02em;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink-bright);
  text-wrap: pretty;
}

.work-row__body {
  margin-top: 9px;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

.tags {
  flex: 0 1 190px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  padding-top: 4px;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 6px;
  background: var(--bg-elev);
}

.work-row__when {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-align: right;
  padding-top: 5px;
}

/* --- experience timeline -------------------------------------------------- */

.tl-item { display: flex; flex-wrap: wrap; align-items: flex-start; }

.tl-when {
  flex: 0 1 156px;
  min-width: 140px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
  padding: 24px 20px 4px 0;
}

.tl-body {
  flex: 1 1 300px;
  min-width: 0;
  padding: 24px 0 30px clamp(18px, 3vw, 28px);
  border-left: 1px solid var(--rule);
  position: relative;
}
.tl-item:last-child .tl-body { padding-bottom: 6px; }

.tl-dot {
  position: absolute;
  left: -3.5px;
  top: 30px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.tl-dot--dim { background: var(--dot-dim); }

.tl-role {
  font-size: clamp(15.5px, 4.2vw, 16.5px);
  letter-spacing: -0.015em;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-bright);
  text-wrap: pretty;
}

.tl-org {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--accent);
}

.tl-note {
  margin-top: 11px;
  max-width: 64ch;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- writing -------------------------------------------------------------- */

.post-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: baseline;
  padding: 20px 12px 20px 0;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink);
  transition: background 160ms ease, padding 160ms ease;
}
.post-row:hover { background: var(--bg-elev); padding-left: 12px; }

.post-row__title {
  flex: 1 1 260px;
  min-width: 0;
  font-size: clamp(15px, 4.2vw, 15.5px);
  letter-spacing: -0.015em;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink-bright);
  text-wrap: pretty;
}
.post-row__kind { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.post-row__when {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-align: right;
}

/* --- contact -------------------------------------------------------------- */

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 6vw, 40px) 64px;
  align-items: flex-start;
}

.contact-main { flex: 1 1 340px; min-width: 0; }

.contact-email {
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
  font-size: clamp(21px, 6.2vw, 42px);
  letter-spacing: -0.035em;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink-bright);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}
.contact-email:hover { color: var(--accent); }

.contact-note {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.contact-links {
  flex: 0 1 260px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 12px;
}
.contact-links__rule { height: 1px; background: var(--rule); margin-bottom: 5px; }
.contact-links a {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--ink-dim);
}
.contact-links a:hover { color: var(--accent); }
.contact-links__key { color: var(--faint); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: rgba(16, 15, 14, 0.72);
}

.site-footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}

.bg-toggle { display: flex; align-items: center; gap: 10px; }
.bg-toggle__sep { color: var(--dot-dim); }

.bg-btn {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1;
  padding: 15px 8px;
  margin: -15px -8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--faint);
}
.bg-btn.is-on { color: var(--accent); }

/* --- motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip,
  .work-row,
  .post-row { transition: none; }
}
