/* ===========================================================================
   styles-v2.css: revised type scale and hierarchy.
   Changes from styles.css:
   - Jubilee Diamond dropped (eyebrow removed). Two Jubilee grades + one mono.
   - Three prose sizes instead of one: hero > lead section > body sections.
   - Shipped list descriptions in ink, not muted; names one step larger.
   - Section numbers are a real mono column, not a 9px superscript.
   - Portrait stacks above the headline under 600px.
   - Cursor hint hidden on touch devices.
   - Dead accordion / work-grid rules removed.
   =========================================================================== */

@font-face {
  font-family: "Jubilee Golden";
  src: url("./fonts/OTJubilee-GoldenMedium.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Jubilee Golden";
  src: url("./fonts/OTJubilee-GoldenMediumItalic.woff2") format("woff2");
  font-display: swap;
  font-style: italic;
  font-weight: 500;
}

@font-face {
  font-family: "Jubilee Golden";
  src: url("./fonts/OTJubilee-GoldenExtrabold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 800;
}

@font-face {
  font-family: "Jubilee Silver";
  src: url("./fonts/OTJubilee-SilverMedium.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Jubilee Silver";
  src: url("./fonts/OTJubilee-SilverMediumItalic.woff2") format("woff2");
  font-display: swap;
  font-style: italic;
  font-weight: 500;
}

@font-face {
  font-family: "Jubilee Silver";
  src: url("./fonts/OTJubilee-SilverExtrabold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 800;
}

@font-face {
  font-family: "Departure Mono";
  src: url("./fonts/DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

/* --- tokens ----------------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-soft: #2c2c2c;
  --muted: #6f6f6a;
  --line: #dcdcd7;
  --soft: #f7f7f4;

  --editorial: "Jubilee Golden", Georgia, serif;
  --ui: "Jubilee Silver", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Departure Mono", monospace;

  --page-width: 45rem;
  --section-pad: clamp(3.5rem, 7vw, 5.5rem);

  /* Type scale. Three prose sizes, each a clear step from the next. */
  --fs-hero: clamp(2.25rem, 4.6vw, 3.25rem);   /* 52px desktop */
  --fs-lead: clamp(1.5rem, 3vw, 2rem);         /* 32px desktop */
  --fs-body: clamp(1.25rem, 2.3vw, 1.5rem);    /* 24px desktop */
  --fs-desc: 1.25rem;                          /* 20px */
  --fs-label: 0.82rem;                         /* 13px */
  --fs-meta: 0.8rem;                           /* 12.8px */

  color-scheme: light;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-synthesis: none;
  font-weight: 500;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
}

h1,
h2,
p {
  margin-top: 0;
}

strong,
b {
  font-weight: 800;
}

a,
button,
summary {
  color: inherit;
}

a {
  text-underline-offset: 0.2em;
}

/* --- shell ------------------------------------------------------------------ */

.site-header,
.site-shell,
.site-footer {
  width: min(calc(100% - 2.5rem), var(--page-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2.5rem;
  font-family: var(--ui);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.wordmark {
  font-weight: 800;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 1.75rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header a:hover,
.site-header a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

/* --- intro ------------------------------------------------------------------ */

.intro {
  padding: var(--section-pad) 0 3rem;
  border-bottom: 1px solid var(--ink);
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.75rem, 5vw, 3rem);
  margin-bottom: 2.25rem;
}

.identity-copy {
  flex: 1 1 0;
  min-width: 0;
}

.intro h1 {
  max-width: 34rem;
  margin-bottom: 0;
  font-family: var(--editorial);
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

.intro-note {
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 400;
  line-height: 1.6;
}

/* --- portrait --------------------------------------------------------------- */

.portrait-block {
  display: inline-grid;
  flex: 0 0 auto;
  justify-items: center;
}

.portrait-ring {
  position: relative;
  display: grid;
  width: 11.5rem;
  aspect-ratio: 1;
  place-items: center;
}

.portrait {
  position: relative;
  width: 10.1rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #17191f;
  isolation: isolate;
  touch-action: pan-y;
}

.portrait-hint {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

/* No cursor on touch devices, so no hint. */
@media (hover: none) {
  .portrait-hint {
    display: none;
  }
}

.portrait-fallback,
.portrait-photo,
.portrait-photo-optimized,
.portrait-directional,
.portrait-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.portrait-fallback {
  z-index: 0;
}

.portrait-frame {
  z-index: 1;
}

.portrait-photo,
.portrait-photo-optimized,
.portrait-directional {
  z-index: 3;
  display: none;
}

.portrait-photo {
  object-position: center;
}

.portrait[data-render-mode="photo"] .portrait-photo,
.portrait[data-render-mode="photo-optimized"] .portrait-photo-optimized,
.portrait[data-render-mode^="openai"] .portrait-directional,
.portrait[data-render-mode^="hf-"] .portrait-directional {
  display: block;
}

.portrait[data-render-mode="photo"],
.portrait[data-render-mode="photo-optimized"],
.portrait[data-render-mode^="openai"],
.portrait[data-render-mode^="hf-"] {
  background: var(--paper);
}

.portrait:is(
    [data-render-mode="photo"],
    [data-render-mode="photo-optimized"],
    [data-render-mode^="openai"],
    [data-render-mode^="hf-"]
  )
  :is(.portrait-fallback, .portrait-frame, .loading) {
  display: none;
}

.loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(23 25 31 / 72%);
  color: #eeeeea;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.loading.is-hidden {
  visibility: hidden;
  opacity: 0;
}

/* --- content ---------------------------------------------------------------- */

.content {
  padding: 3.5rem 0 var(--section-pad);
}

.prose-section + .prose-section {
  margin-top: 4rem;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-family: var(--ui);
  font-size: var(--fs-label);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.prose p {
  max-width: none;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--editorial);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.008em;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

/* The first section carries the most weight. One step up. */
.prose-section--lead .prose p {
  color: var(--ink);
  font-size: var(--fs-lead);
  line-height: 1.42;
  letter-spacing: -0.012em;
}

.prose p + p {
  margin-top: 1.5rem;
}

.prose em {
  font-style: italic;
}

.prose a:not(.tipranks-link) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgb(44 44 44 / 35%);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 160ms;
}

.prose a:not(.tipranks-link):hover,
.prose a:not(.tipranks-link):focus-visible {
  text-decoration-color: var(--ink-soft);
}

/* --- TipRanks inline mark --------------------------------------------------- */

.tipranks-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  margin-inline: 0.04em;
  color: inherit;
  text-decoration: none;
  vertical-align: baseline;
  white-space: nowrap;
}

.tipranks-link__mark {
  flex-shrink: 0;
  width: auto;
  height: 0.82em;
  transition: transform 160ms ease;
}

.tipranks-link__name {
  text-decoration: underline;
  text-decoration-color: rgb(44 44 44 / 35%);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 160ms ease;
}

.tipranks-link:hover .tipranks-link__mark,
.tipranks-link:focus-visible .tipranks-link__mark {
  transform: translateY(-1px);
}

.tipranks-link:hover .tipranks-link__name,
.tipranks-link:focus-visible .tipranks-link__name {
  text-decoration-color: #ff9600;
}

/* --- shipped list ----------------------------------------------------------- */

.project-list {
  margin: 2.25rem 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.project-title-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.p-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.p-arrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0;
  transform: translateX(-0.15rem);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease;
}

/* Descriptions are the proof on this page. They read in ink, not grey. */
.p-desc {
  grid-column: 1 / -1;
  display: block;
  max-width: 36rem;
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-family: var(--editorial);
  font-size: var(--fs-desc);
  font-weight: 500;
  line-height: 1.5;
}

.p-desc a {
  text-decoration: underline;
  text-decoration-color: rgb(17 17 17 / 35%);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.p-desc a:hover,
.p-desc a:focus-visible,
.project-row:hover .p-arrow,
.project-row:focus-within .p-arrow {
  color: var(--ink);
}

.p-desc a:hover,
.p-desc a:focus-visible {
  text-decoration-color: var(--ink);
}

.project-row:hover .p-name,
.project-row:focus-within .p-name {
  text-decoration: underline;
  text-decoration-color: rgb(17 17 17 / 35%);
  text-underline-offset: 0.15em;
}

.project-row:hover .p-arrow,
.project-row:focus-within .p-arrow {
  opacity: 1;
  transform: translateX(0);
}

.p-meta {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

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

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.2rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  border-color: var(--ink);
  background: var(--soft);
}

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

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.6;
}

.site-footer a {
  flex: 0 0 auto;
  text-decoration: none;
}

.colophon {
  display: grid;
  gap: 0.35rem;
  max-width: 28rem;
}

/* --- small screens ---------------------------------------------------------- */

@media (max-width: 600px) {
  .site-header,
  .site-shell,
  .site-footer {
    width: min(calc(100% - 2rem), var(--page-width));
  }

  .site-header {
    padding-top: 1.5rem;
  }

  .intro {
    padding-top: 3rem;
  }

  /* Portrait above the headline. The sentence gets the full column. */
  .identity-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
  }

  .portrait-block {
    order: -1;
  }

  .portrait-ring {
    width: 7rem;
  }

  .portrait {
    width: 6.5rem;
  }

  .intro h1 {
    font-size: clamp(1.9rem, 8.6vw, 2.35rem);
    line-height: 1.2;
  }

  .prose-section + .prose-section {
    margin-top: 3rem;
  }

  .section-label {
    margin-bottom: 1rem;
  }

  .prose p {
    font-size: 1.2rem;
    line-height: 1.5;
  }

  .prose-section--lead .prose p {
    font-size: 1.4rem;
    line-height: 1.42;
  }

  .prose p + p {
    margin-top: 1.25rem;
  }

  .project-list {
    margin-top: 1.75rem;
  }

  .project-row {
    padding: 1.15rem 0;
  }

  .p-name {
    font-size: 0.9rem;
  }

  .p-desc {
    font-size: 1.1rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 1rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .tipranks-link:hover .tipranks-link__mark,
  .tipranks-link:focus-visible .tipranks-link__mark {
    transform: none;
  }
}
