/*
  Ian Adera portfolio, "Receipts" design system.
  No framework. Hand-written CSS. Archivo variable font only.
*/

/* ---------------------------------------------------------------
   Tokens
--------------------------------------------------------------- */

:root {
  --paper: oklch(0.965 0.012 78);
  --paper-2: oklch(0.935 0.016 78);
  --ink: oklch(0.23 0.018 60);
  --ink-2: oklch(0.45 0.02 60);
  --rule: oklch(0.23 0.018 60 / 0.16);
  --oxide: oklch(0.53 0.165 38);
  --oxide-deep: oklch(0.44 0.145 38);
  --oxide-tint: oklch(0.92 0.04 45);
  --on-oxide: oklch(0.975 0.012 78);
  --on-oxide-dim: oklch(0.93 0.03 70);
  --rule-on-oxide: oklch(0.975 0.012 78 / 0.4);

  --container-max: 1320px;
  --container-pad: clamp(1.25rem, 4vw, 3.5rem);
  --section-pad: clamp(4rem, 10vw, 9rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------
   Reset
--------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-stretch: 100%;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

table {
  border-collapse: collapse;
}

button {
  font: inherit;
}

/* ---------------------------------------------------------------
   Layout primitives
--------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  border-inline: 1px solid var(--rule);
}

.oxide .container {
  border-color: var(--rule-on-oxide);
}

.band-oxide {
  background: var(--oxide);
  color: var(--on-oxide);
}

.band-paper {
  background: var(--paper);
}

.band-paper-2 {
  background: var(--paper-2);
}

section {
  padding-block: var(--section-pad);
}

.about-strip {
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

/* ---------------------------------------------------------------
   Typography roles
--------------------------------------------------------------- */

h1,
h2 {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-stretch: 70%;
  line-height: 0.95;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-stretch: 100%;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}

.lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-stretch: 100%;
  font-weight: 400;
  line-height: 1.35;
  max-width: 34ch;
}

.eyebrow {
  font-size: 0.75rem;
  font-stretch: 75%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.receipt-line {
  font-size: 0.9375rem;
  font-stretch: 62%;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------
   Focus
--------------------------------------------------------------- */

a,
button {
  outline-offset: 3px;
}

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

.oxide :focus-visible {
  outline-color: var(--on-oxide);
}

/* ---------------------------------------------------------------
   Header / top bar
--------------------------------------------------------------- */

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
}

.logo {
  font-size: 1.0625rem;
  font-stretch: 68%;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
}

.site-nav a {
  font-size: 0.9375rem;
  font-stretch: 85%;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color 120ms;
}

.site-nav a:hover {
  border-color: var(--oxide-deep);
}

.cv-link {
  font-size: 0.9375rem;
  font-stretch: 85%;
  font-weight: 700;
  text-decoration: none;
  color: var(--oxide-deep);
  border-bottom: 1.5px solid var(--oxide-deep);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Hero
--------------------------------------------------------------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem);
}

.hero .container {
  container-type: inline-size;
  container-name: hero;
}

.hero-name {
  margin: 0;
  font-stretch: 62%;
  line-height: 0.85;
  white-space: nowrap;
  font-size: clamp(3rem, 26cqi, 20rem);
}

.hero-name .line {
  display: inline;
}

.hero-lockup {
  margin-top: clamp(2rem, 6vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem 2.5rem;
}

.hero-lead-col {
  max-width: 34ch;
}

@media (min-width: 900px) {
  .lead,
  .hero-lead-col {
    max-width: 44ch;
  }
}

.hero-role {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  font-stretch: 78%;
  font-weight: 500;
  color: var(--on-oxide);
}

.hero-side {
  display: flex;
  align-items: flex-end;
  gap: clamp(1.5rem, 3vw, 3rem);
  flex-wrap: wrap;
}

/* Receipt block, used in hero and contact */

.receipt-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 15rem;
}

.receipt-row {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.receipt-label,
.receipt-value {
  font-size: 0.8125rem;
  font-stretch: 62%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receipt-label {
  color: var(--on-oxide-dim);
}

.receipt-value {
  color: var(--on-oxide);
}

.receipt-leader {
  flex: 1 1 2rem;
  align-self: flex-end;
  margin-bottom: 0.3em;
  border-bottom: 2px dotted var(--rule-on-oxide);
  min-width: 1rem;
}

.stamp {
  flex: 0 0 auto;
  border: 1.5px solid var(--on-oxide);
  border-radius: 2px;
  padding: 0.85rem 1.1rem;
  transform: rotate(-6deg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  white-space: nowrap;
}

.stamp span {
  font-size: 0.75rem;
  font-stretch: 62%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-oxide);
}

/* ---------------------------------------------------------------
   About strip
--------------------------------------------------------------- */

.about-strip p {
  font-size: 0.9375rem;
  font-stretch: 78%;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.about-strip a {
  color: var(--oxide-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

/* ---------------------------------------------------------------
   Section intros
--------------------------------------------------------------- */

.section-head {
  max-width: 46rem;
}

.section-intro {
  margin-top: 0.85rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  font-stretch: 100%;
  font-weight: 400;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------------------------------------------------------------
   Work
--------------------------------------------------------------- */

.work {
  overflow-x: clip;
}

.work-list {
  margin-top: clamp(3rem, 7vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 8vw, 6.5rem);
}

.work-entry {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.work-index {
  font-size: 2.5rem;
  font-stretch: 62%;
  font-weight: 300;
  color: var(--oxide);
  line-height: 1;
}

.work-copy {
  max-width: 44rem;
}

.eyebrow + h3,
h3 + .work-desc {
  margin-top: 0.5rem;
}

.eyebrow {
  display: block;
}

.work-desc {
  margin-top: 0.9rem;
  color: var(--ink);
  max-width: 52ch;
}

.work-meta {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px dotted var(--rule);
}

.verify {
  font-size: 1rem;
  font-stretch: 90%;
  font-weight: 600;
  text-decoration: none;
  color: var(--oxide-deep);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  text-decoration-line: underline;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  transition: text-decoration-thickness 120ms;
}

.verify:hover {
  text-decoration-thickness: 3px;
}

.verify .arrow {
  display: inline-block;
  transition: transform 120ms;
}

.verify:hover .arrow {
  transform: translate(2px, -2px);
}

.chip {
  font-size: 0.75rem;
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--oxide-tint);
  color: var(--oxide-deep);
  padding: 0.4em 0.65em;
  border-radius: 2px;
  white-space: nowrap;
}

.work-media {
  border: 1px solid var(--rule);
  padding: 3px;
  background: var(--oxide-tint);
  margin-inline: calc(-1 * var(--container-pad));
}

.work-media img {
  width: 100%;
  height: auto;
  transition: transform 400ms;
}

.work-media:hover img {
  transform: scale(1.015);
}

/* DiraAi: typographic entry, no image */
.work-entry--flat .work-copy {
  max-width: 56rem;
}

.work-entry--flat .work-desc {
  max-width: 62ch;
}

/* Pipeline sub-list */

.pipeline {
  margin-top: clamp(4rem, 9vw, 6.5rem);
  padding-top: clamp(2.5rem, 6vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

.pipeline-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pipeline-entry {
  padding-top: 1.5rem;
  border-top: 1px dotted var(--rule);
}

.pipeline-entry:first-child {
  border-top: none;
  padding-top: 0;
}

.pipeline-entry h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.pipeline-entry .work-desc {
  margin-top: 0.7rem;
}

.pipeline-entry .work-meta {
  border-top: none;
  padding-top: 0.7rem;
}

/* ---------------------------------------------------------------
   Ledger (Career, Writing)
--------------------------------------------------------------- */

.ledger {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  display: flex;
  flex-direction: column;
}

.ledger-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}

.ledger-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.ledger-date {
  font-size: 0.8125rem;
  font-stretch: 62%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--oxide-deep);
  font-variant-numeric: tabular-nums;
}

.ledger-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1em 0.6em;
}

.ledger-company {
  font-size: 1.125rem;
  font-stretch: 90%;
  font-weight: 700;
}

.ledger-role {
  font-size: 0.9375rem;
  font-stretch: 90%;
  font-weight: 500;
  color: var(--ink-2);
}

.ledger-body {
  color: var(--ink);
  max-width: 62ch;
}

.ledger-title a {
  font-size: 1.125rem;
  font-stretch: 90%;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

.ledger-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--oxide-deep);
}

.medium-line {
  margin-top: 0.75rem;
}

.medium-line a {
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--oxide-deep);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  border-bottom: 1.5px solid var(--oxide-deep);
  padding-bottom: 1px;
}

/* ---------------------------------------------------------------
   Stack
--------------------------------------------------------------- */

.spec-sheet {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.spec-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.spec-row dt {
  font-size: 0.8125rem;
  font-stretch: 70%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--oxide-deep);
}

.spec-row dd {
  font-size: 0.9375rem;
  font-stretch: 62%;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  max-width: 62ch;
}

@media (min-width: 900px) {
  .spec-row {
    display: grid;
    grid-template-columns: 13rem 1fr;
    column-gap: 1.75rem;
    align-items: baseline;
  }

  .spec-row dd {
    max-width: 72ch;
  }
}

/* ---------------------------------------------------------------
   Contact
--------------------------------------------------------------- */

.contact h2 {
  max-width: 12ch;
}

.contact-actions {
  margin-top: clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: 1.75rem;
  border-radius: 2px;
  border: 1.5px solid var(--on-oxide);
  background: var(--paper);
  color: var(--oxide-deep);
  font-size: 0.9375rem;
  font-stretch: 85%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.btn:hover {
  background: var(--on-oxide-dim);
}

.contact-links {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.contact-links a {
  font-size: 1rem;
  font-stretch: 85%;
  font-weight: 600;
  text-decoration: none;
  color: var(--on-oxide);
  border-bottom: 1.5px solid var(--rule-on-oxide);
  padding-bottom: 2px;
}

.contact-links a:hover {
  border-color: var(--on-oxide);
}

.contact .receipt-block {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--rule-on-oxide);
  max-width: 34rem;
}

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */

.site-footer {
  padding-block: 2rem;
}

.site-footer p {
  font-size: 0.875rem;
  font-stretch: 85%;
  color: var(--ink-2);
}

.site-footer a {
  color: var(--oxide-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

/* ---------------------------------------------------------------
   Motion / reveal
   Default state: everything visible. JS adds .js-reveal to <html>
   which arms the hidden starting states; IntersectionObserver (or
   an immediate stagger for load elements) then adds .is-visible.
--------------------------------------------------------------- */

.js-reveal [data-reveal="load"] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.js-reveal [data-reveal="load"].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* The clip-path lives on .work-media, but the intersection target is its
   unclipped parent (a zero-height clip-path makes an element permanently
   unintersectable, so the two roles must not be the same element). */
.js-reveal [data-reveal="scroll"] .work-media {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 900ms var(--ease);
}

.js-reveal [data-reveal="scroll"].is-visible .work-media {
  clip-path: inset(0 0 0 0);
}

.js-reveal [data-reveal="row"] {
  opacity: 0;
  transition: opacity 400ms ease;
}

.js-reveal [data-reveal="row"].is-visible {
  opacity: 1;
}

.js-reveal [data-reveal="row"]:nth-child(1) { transition-delay: 0ms; }
.js-reveal [data-reveal="row"]:nth-child(2) { transition-delay: 40ms; }
.js-reveal [data-reveal="row"]:nth-child(3) { transition-delay: 80ms; }
.js-reveal [data-reveal="row"]:nth-child(4) { transition-delay: 120ms; }
.js-reveal [data-reveal="row"]:nth-child(5) { transition-delay: 160ms; }
.js-reveal [data-reveal="row"]:nth-child(6) { transition-delay: 200ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .work-media img,
  .verify .arrow,
  .site-nav a,
  .btn {
    transition: none !important;
  }
}

/* ---------------------------------------------------------------
   Breakpoints
--------------------------------------------------------------- */

/* Tablet: 640px and up */
@media (min-width: 640px) {
  .hero-name {
    white-space: nowrap;
  }

  .hero-lockup {
    flex-wrap: nowrap;
  }

  .work-media {
    margin-inline: 0;
  }

  .site-nav {
    order: 0;
  }
}

/* Below tablet: stack the hero name to two lines, drop nowrap */
@media (max-width: 639.98px) {
  .hero-name {
    display: flex;
    flex-direction: column;
    font-size: clamp(3.75rem, 21vw, 6.5rem);
    white-space: normal;
    gap: 0;
  }

  .hero-lockup {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-side {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
  }

  .work-media {
    margin-inline: calc(-1 * var(--container-pad));
  }

  .site-header .container {
    padding-block: 1rem;
  }

  /* DESIGN.md phone spec: index number shrinks and sits above the H3,
     rather than beside it (which is the ≥640px tablet treatment). */
  .work-copy-wrap {
    flex-direction: column;
    gap: 0.35rem;
  }

  .work-index {
    font-size: 2.5rem;
  }
}

/* Desktop: 900px and up, Work alternates and bleeds.
   Grid, not flex: a flex item's fixed flex-basis locks its own box size,
   so a negative trailing margin has no visible effect (verified in the
   browser loop). A stretched grid item's box is (track size - margins),
   so a negative margin on its outer edge correctly grows it past the
   track and off the container, which is what "bleed" requires. */
@media (min-width: 900px) {
  .work {
    --bleed: calc((100vw - min(var(--container-max), 100vw)) / 2 + var(--container-pad));
  }

  .work-entry {
    display: grid;
    grid-template-columns: 7fr 5fr;
    align-items: center;
    column-gap: clamp(2rem, 4vw, 4rem);
  }

  .work-entry[data-side="right"] .work-copy-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  .work-entry[data-side="right"] .work-media {
    grid-column: 2;
    grid-row: 1;
    margin-inline-end: calc(-1 * var(--bleed));
    margin-inline-start: 0;
  }

  .work-entry[data-side="left"] {
    grid-template-columns: 5fr 7fr;
  }

  .work-entry[data-side="left"] .work-media {
    grid-column: 1;
    grid-row: 1;
    margin-inline-start: calc(-1 * var(--bleed));
    margin-inline-end: 0;
  }

  .work-entry[data-side="left"] .work-copy-wrap {
    grid-column: 2;
    grid-row: 1;
  }

  .work-entry--flat {
    display: block;
  }

  .work-entry--flat .work-copy-wrap {
    max-width: none;
  }

  .work-copy-wrap {
    display: flex;
    gap: 1.5rem;
  }

  .work-index {
    font-size: clamp(3rem, 6vw, 5.5rem);
    flex: 0 0 auto;
  }

  /* Ledger becomes a real table: date, heading, description and tech as
     side-by-side columns. DESIGN.md only specifies the stacked anatomy
     for phone ("collapse"); below 900px this file keeps that same
     stacked reading rather than cramming four columns into a narrow
     tablet width. */
  .ledger-row {
    display: grid;
    grid-template-columns: 8rem 13rem 1fr 13rem;
    column-gap: 1.75rem;
    align-items: start;
    padding-block: 1.5rem;
  }

  .ledger-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .ledger-body {
    max-width: 46ch;
  }

  .receipt-line {
    max-width: none;
  }
}

/* Tablet only (640-899px): index sits beside the H3, not above it (that
   stacked treatment is phone-only, handled in the max-width:639.98px
   query above). Scoped as a range so the two rules never fight on
   source order at phone widths. */
@media (min-width: 640px) and (max-width: 899.98px) {
  .work-copy-wrap {
    display: flex;
    gap: 1.25rem;
  }
}

/* ---------------------------------------------------------------
   Print
--------------------------------------------------------------- */

@media print {
  * ,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    clip-path: none !important;
  }

  /* Reveal-on-scroll must never hide content from a printed page: a
     recruiter who prints (or saves as PDF) before scrolling must see
     everything, not just what has already animated in. */
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .band-oxide {
    background: var(--paper) !important;
    color: var(--ink) !important;
    border-top: 2px solid var(--oxide);
  }

  .receipt-label,
  .receipt-value,
  .stamp span,
  .hero-role {
    color: var(--ink) !important;
  }

  .receipt-leader {
    border-color: var(--rule) !important;
  }

  .work-media {
    max-width: var(--container-max);
    margin-inline: 0 !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: var(--ink-2);
  }

  .site-header,
  .contact-actions {
    display: none;
  }
}
