/* ==================================================================
   andymoran.io
   Terminal-structured link hub. Hand-written, no framework.
   ================================================================== */

/* --- font --------------------------------------------------------
   JetBrains Mono, latin subset, variable (one file covers 100–800). */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-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 ------------------------------------------------------- */
:root {
  --bg: #0c0f13;
  --surface: #12161c;
  --text: #d6dbe1;
  --muted: #8b939e;
  --accent: #4ade80;
  --rule: #1c2027;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
    'Liberation Mono', monospace;

  --measure: 62ch;
  --col: 640px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
p,
figure {
  margin: 0;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- page --------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  line-height: 1.6;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  padding: clamp(2.5rem, 9vh, 5rem) var(--pad) 4rem;
}

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

/* subtle entrance, only once JS has rendered the rows */
.is-ready .wrap {
  animation: rise 0.55s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* --- header ------------------------------------------------------- */
.head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.avatar {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 3px;
  border: 1px solid var(--rule);
  filter: grayscale(1) contrast(1.05);
  transition: border-color 0.2s var(--ease), filter 0.3s var(--ease);
}

.avatar:hover,
.avatar-button:focus-visible .avatar {
  border-color: var(--accent);
  filter: grayscale(0) contrast(1);
}

.avatar-button {
  grid-row: 1 / 3;
  align-self: center;
  display: block;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 3px;
}

.name {
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cursor {
  color: var(--accent);
  font-weight: 400;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.tagline {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.85em;
}

/* --- bio ---------------------------------------------------------- */
.bio {
  max-width: var(--measure);
  color: #b9c0c9;
  margin-bottom: 2.75rem;
  text-wrap: pretty;
}

/* --- sections ----------------------------------------------------- */
.section {
  margin-bottom: 2.25rem;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78em;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* brackets are decoration; the accessible name stays "work" */
.section__label::before {
  content: '[';
  color: var(--accent);
  margin-right: 0.15em;
}

.section__label::after {
  content: ']';
  color: var(--accent);
  margin-left: 0.15em;
}

.section__head::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* --- rows --------------------------------------------------------- */
.row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  column-gap: 0.85rem;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}

/* the bar that slides in from the left */
.row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.15s var(--ease);
}

.row:hover,
.row:focus-visible {
  background: var(--surface);
}

.row:hover::before,
.row:focus-visible::before {
  transform: scaleX(1);
}

.row:hover .row__num,
.row:focus-visible .row__num {
  color: var(--accent);
}

.row:hover .row__arrow,
.row:focus-visible .row__arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.row__num {
  font-size: 0.78em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s var(--ease);
}

.row__main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

/* block, not flex: a flex container takes its baseline from its first
   item, and an SVG has none — which knocked the row number out of
   alignment on the rows that carry a brand icon. */
.row__label {
  display: block;
  color: var(--text);
  text-wrap: pretty;
}

.row__note {
  font-size: 0.78em;
  color: var(--muted);
}

.row__end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.row__tag {
  font-size: 0.72em;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* relative offset rather than vertical-align: shifting the icon must not
   change the line box, or it drags the row number off the baseline */
.row__icon {
  position: relative;
  top: 0.13em;
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: baseline;
  margin-right: 0.5rem;
  fill: currentColor;
  color: var(--muted);
}

.row__arrow {
  width: 0.75em;
  height: 0.75em;
  flex: none;
  color: #39414b;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}

/* --- footer ------------------------------------------------------- */
.foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78em;
  color: var(--muted);
}

.foot__line::before {
  content: '// ';
  color: var(--accent);
}

/* CFP Board certification marks attribution */
.legal {
  margin-top: 1.5rem;
  max-width: var(--measure);
  font-size: 0.86em;
  line-height: 1.65;
  color: #626a75;
  text-wrap: pretty;
}

/* The marks must stay in capitals; keep any future text-transform off them. */
.marks {
  text-transform: none;
}

/* --- dialog ------------------------------------------------------- */
.dialog {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  padding: 0;
  max-width: min(340px, 90vw);
}

.dialog::backdrop {
  background: rgb(4 6 9 / 0.8);
}

.dialog__body {
  padding: 1rem;
}

.dialog__photo {
  width: 100%;
  border-radius: 4px;
}

.dialog__quote {
  margin-top: 0.9rem;
  font-size: 0.82em;
  color: var(--muted);
  text-align: center;
}

.dialog__close {
  display: block;
  margin: 0.9rem auto 0;
  padding: 0.35rem 0.9rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 0.8em;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.dialog__close:hover,
.dialog__close:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- no-js fallback ----------------------------------------------- */
.noscript-links {
  padding-left: 1.1rem;
}

.noscript-links a {
  color: var(--accent);
}

/* --- focus -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- small screens ------------------------------------------------ */
@media (max-width: 26rem) {
  .row {
    column-gap: 0.6rem;
    padding: 0.6rem 0.5rem;
  }

  .row__tag {
    display: none;
  }
}

/* --- motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }
}
