/* ==========================================================================
   Rolando Scott — portfolio
   ========================================================================== */

/* ---- Fonts (self-hosted variable fonts, latin + latin-ext subsets) ---- */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-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;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/instrument-sans-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;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  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 {
  /* Light: white surfaces, near-black text, one red accent */
  --c-bg: #f7f7f5;
  --c-panel: #e9e9e7;
  --c-surface: #fff;
  --c-surface-glass: rgba(255, 255, 255, 0.9);
  --c-deep: #f4f4f2;
  --c-deep-glass: rgba(255, 255, 255, 0.92);
  --c-button: #fff;
  --c-backdrop: rgba(10, 10, 10, 0.45);
  --c-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);

  --c-line: #d9d9d6;
  --c-line-soft: #e6e6e3;
  --c-line-faint: #e4e4e1;
  --c-rule: #e6e6e3;

  --c-ink: #111;
  --c-body: #3a3a3a;
  --c-muted: #5f5f5f;
  --c-dim: #6e6e6e;
  --c-soft-accent: #c00;

  /* Red (#cc0000) — 5.9:1 as text on white and behind white text (WCAG AA) */
  --c-accent: #c00;
  --c-fill: #c00;
  --c-fill-hover: #a30000;
  --c-on-fill: #fff;
  --c-blue: #0961bb;
  --c-blue: oklch(0.5 0.16 255);

  --f-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --f-body: 'Instrument Sans', Helvetica, Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-card: 22px;
  --radius-cta: 16px;
  --gap: clamp(16px, 2vw, 28px);
}

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

html,
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
}

body { font-family: var(--f-body); }

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

a:hover { color: var(--c-accent); }

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

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

h1, h2, p { margin: 0; }

kbd { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Utilities ---------------------------------------------------------- */
.mono { font-family: var(--f-mono); font-size: 13px; }
.text-accent { color: var(--c-accent); }
.text-dim { color: var(--c-dim); }
.dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot--accent { background: var(--c-accent); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ---- Page layout -------------------------------------------------------- */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  overflow: hidden;
  background-color: var(--c-bg);
}

/* Faint texture of config, code and shell snippets, strongest around the
   cards and fading out towards the page edges */
.page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('../img/bg-code.svg') center / 980px 720px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
}

.layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: stretch;
  gap: var(--gap);
}

.card {
  position: relative;
  max-width: 100%;
  border-radius: var(--radius-card);
  box-shadow: var(--c-shadow);
}

/* ---- Portrait card ------------------------------------------------------ */
.portrait {
  flex: 1 1 440px;
  min-height: min(46vh, 380px);
  overflow: hidden;
  background: var(--c-panel);
}

.portrait__media {
  position: absolute;
  inset: 0;
}

.portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 30%;
}

/* Line-engraving effect (like a banknote portrait): a fine angled line screen
   is colour-dodged onto a dark, softened greyscale photo, then extreme
   contrast snaps it to solid ink lines whose width follows the tone. The
   lines are drawn at an angle directly (not rotated) to avoid moiré. */
.engraving {
  --line-pitch: 5px;
  overflow: hidden;
  background: #fff;
  filter: contrast(20);
}
.engraving .portrait__img { filter: grayscale(1) brightness(0.5) contrast(1.3) blur(1px); }
.engraving::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(150deg, #fff 0, #000 calc(var(--line-pitch) / 2), #fff var(--line-pitch));
  mix-blend-mode: color-dodge;
  pointer-events: none;
}
@media (max-width: 700px) {
  .engraving { --line-pitch: 4px; }
}

.portrait__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Footer: location chip + stats */
.portrait__footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chip {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--c-surface-glass);
  font-size: 13px;
  color: var(--c-ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 14px;
  background: var(--c-deep-glass);
  border: 1px solid var(--c-line);
  overflow: hidden;
}

.stats__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
}
.stats__item + .stats__item { border-left: 1px solid var(--c-line-faint); }

.stats__value {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-ink);
}
.stats__value--accent { color: var(--c-accent); }
.stats__value--blue { color: var(--c-blue); }

.stats__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ---- Content card ------------------------------------------------------- */
.content {
  flex: 1.1 1 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(18px, 2.6vh, 32px);
  padding: clamp(18px, 2.4vw, 32px);
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
}

.content__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
}

.content__id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--c-ink);
}

.role {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.role__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 500;
  color: var(--c-ink);
}

.role__logo {
  width: 128px;
  height: 55px;
  margin: -6px 0 -6px 8px;
  object-fit: contain;
  filter: invert(1); /* the logo artwork is white-on-transparent */
}

/* About */
.about {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 20px);
  padding-top: clamp(18px, 3vh, 32px);
  border-top: 1px solid var(--c-rule);
}

.shell-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 6px;
  border: 1px solid var(--c-line);
  background: var(--c-deep);
  color: var(--c-muted);
  font-family: var(--f-mono);
  font-size: 11px;
  cursor: pointer;
}
.shell-btn:hover,
.shell-btn:focus-visible {
  border-color: var(--c-accent);
  color: var(--c-ink);
}
.shell-btn kbd {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--c-line-faint);
  color: var(--c-ink);
}

/* Typewriter tagline: the invisible "ghost" copy reserves the final size so
   the layout doesn't shift while the visible copy types out on top of it. */
.tagline {
  display: grid;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  text-wrap: balance;
}
.tagline__ghost,
.tagline__typed { grid-area: 1 / 1; }
.tagline__ghost { visibility: hidden; }

.cursor {
  display: inline-block;
  width: 0.08em;
  height: 0.85em;
  margin-left: 0.08em;
  vertical-align: -0.06em;
  background: var(--c-accent);
  /* Blinks for a few seconds, then settles (WCAG 2.2.2) */
  animation: rs-blink 1s steps(1) 8;
}

.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 500;
  color: var(--c-soft-accent);
}

.bio {
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  max-width: 68ch;
  font-size: clamp(15px, 1.05vw, 16.5px);
  line-height: 1.6;
  color: var(--c-body);
  text-wrap: pretty;
}

/* ---- Calls to action ---------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.cta {
  position: relative;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: var(--radius-cta);
  border: 1px solid var(--c-line);
  background: var(--c-button);
  font-size: 15px;
  font-weight: 600;
}
.cta:hover {
  border-color: var(--c-accent);
  color: var(--c-ink);
}

.cta--primary {
  flex: 1 1 220px;
  justify-content: space-between;
  gap: 16px;
  border-color: transparent;
  background: var(--c-fill);
  color: var(--c-on-fill);
}
.cta--primary:hover {
  border-color: transparent;
  background: var(--c-fill-hover);
  color: var(--c-on-fill);
}

.cta__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cta__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cta__title {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
}

.cta__arrow { font-size: 24px; }

.linkedin-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #0a66c2;
  color: #fff;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Terminal dialog ---------------------------------------------------- */
.term {
  /* The terminal stays dark: re-scope the colour tokens */
  --c-bg: #111;
  --c-deep: #0a0a0a;
  --c-line: #2e2e2e;
  --c-line-soft: #222;
  --c-ink: #f5f2ee;
  --c-body: #c9c9c9;
  --c-muted: #a3a3a3;
  --c-dim: #8a8a8a;
  --c-accent: #ff3b30;
  --c-ok: #7ee0a1;

  width: min(640px, calc(100% - 40px));
  height: min(420px, 80vh);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--c-line);
  background: var(--c-deep);
  color: var(--c-ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  font-family: var(--f-mono);
  font-size: 13px;
}
.term[open] {
  display: flex;
  flex-direction: column;
}
.term::backdrop {
  background: var(--c-backdrop);
  backdrop-filter: blur(4px);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line-soft);
}

.term__light {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.term__light--red { background: #ff5f57; }
.term__light--yellow { background: #febc2e; }
.term__light--green { background: #28c840; }

.term__title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: var(--c-muted);
}

.term__close {
  appearance: none;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-muted);
  font-family: var(--f-mono);
  font-size: 11px;
  cursor: pointer;
}
.term__close:hover { border-color: var(--c-accent); color: var(--c-ink); }

.term__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  overflow: auto;
  line-height: 1.5;
}

.term__log {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.term__line { white-space: pre-wrap; color: var(--c-body); }
.term__line--echo { color: var(--c-ink); }
.term__line--dim { color: var(--c-dim); }
.term__line--hi { color: var(--c-accent); }
.term__line--ok { color: var(--c-ok); }

.term__prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.term__prompt label { flex: none; }

.term__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--c-ink);
  font: inherit;
  caret-color: var(--c-accent);
}
/* Focus is indicated on the whole prompt row instead of the bare input */
.term__prompt:has(.term__input:focus-visible) {
  outline: 1px dashed var(--c-line);
  outline-offset: 4px;
}

/* ---- Animations --------------------------------------------------------- */
@keyframes rs-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .cta,
  .shell-btn,
  .term__close { border: 1px solid ButtonText; }
}

/* ---- 404 page ----------------------------------------------------------- */
.content--narrow {
  flex: none;
  width: min(560px, 100%);
  justify-content: flex-start;
}
