/* ==========================================================================
   TechTrans case study (js/techtrans.js). Loaded after portfolio.css and built
   on its tokens: --u, the fonts, --pf-ink, --pf-bg, the hairline rule and the
   section rhythm. Every new class starts with "tt-"; nothing in the shared
   project template is changed.
   ========================================================================== */

:root {
  --tt-gap-section: var(--pf-gap-text);         /* between the big sections */
  --tt-gap-block: calc(64 * var(--u));          /* between blocks in a section */
  --tt-gap-title: calc(18 * var(--u));          /* label -> title -> content */
  --tt-gap-media: calc(32 * var(--u));          /* text -> screens */
  --tt-row-gap: calc(16 * var(--u));            /* between screens in a row */
  --tt-label-size: var(--pf-filter-size);
  --tt-title-size: calc(40 * var(--u));
  --tt-headline-size: calc(32 * var(--u));
  --tt-lead-size: var(--pf-subtitle-size);
  --tt-number-size: calc(72 * var(--u));
  --tt-outcome-size: calc(56 * var(--u));
  --tt-copy-width: var(--pf-about-width);
  --tt-small-width: 40%;                        /* the optional small screen */
  --tt-caption-size: max(12px, var(--pf-caption-size));
  --tt-columns: 2;
}

.pf .tt-section h3,
.pf .tt-section figure,
.pf .tt-hero figure {
  margin: 0;
  font-weight: inherit;
  font-size: inherit;
}

/* ---------- Shared pieces ---------- */

.tt-section {
  margin-top: var(--tt-gap-section);
}

.pf .tt-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--tt-label-size);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.tt-eyebrow {
  text-transform: uppercase;
}

.tt-title {
  margin-top: var(--tt-gap-title);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--tt-title-size);
  line-height: 1.15;
  text-wrap: balance;
}

.tt-lead,
.tt-copy,
.tt-feature__text {
  max-width: var(--tt-copy-width);
  font-family: var(--font-body);
  text-wrap: pretty;
}

.tt-lead {
  font-size: var(--tt-lead-size);
  line-height: 1.4;
}

.tt-copy,
.tt-feature__text {
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.tt-label + .tt-lead,
.tt-label + .tt-copy {
  margin-top: calc(8 * var(--u));
}

.tt-block {
  margin-top: var(--tt-gap-block);
}

.tt-title + .tt-block {
  margin-top: calc(40 * var(--u));
}

.tt-note,
.tt-caption {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--tt-caption-size);
  line-height: 1.4;
}

.tt-caption {
  margin-top: calc(10 * var(--u));
}

/* ---------- Screens ---------- */

.tt-shot {
  min-width: 0;
}

.tt-shot__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--tt-ratio);
  background: var(--pf-placeholder);
}

/* a hairline keeps white app screens from melting into the page */
.tt-shot__img {
  outline: var(--pf-rule) solid color-mix(in srgb, var(--pf-ink) 14%, transparent);
  outline-offset: calc(-1 * var(--pf-rule));
}

.tt-shot__img:focus-visible {
  outline: var(--pf-rule) solid var(--pf-ink);
  outline-offset: 4px;
}

/* screens side by side at one height (flex-grow = width / height) */
.tt-row {
  display: flex;
  align-items: flex-start;
  gap: var(--tt-row-gap);
  margin-top: var(--tt-row-gap);
}

.tt-row__item {
  flex: 1 1 0;
}

.tt-shot--small {
  width: var(--tt-small-width);
  margin-top: calc(32 * var(--u));
}

/* ---------- Overview ---------- */

.tt-hero__headline {
  margin-top: calc(18 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--tt-headline-size);
  line-height: 1.15;
}

.tt-hero__description {
  max-width: var(--tt-copy-width);
  margin-top: calc(12 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-subtitle-size);
  line-height: 1.4;
  text-wrap: pretty;
}

.tt-hero__media {
  margin-top: var(--pf-gap-hero);
}

.tt-hero__media .tt-shot__img {
  outline: none;
}

.tt-overview {
  margin-top: var(--pf-gap-snapshot);
}

.tt-overview__facts dd {
  min-width: 0;
}

.tt-overview__context,
.tt-outcome {
  margin-top: calc(40 * var(--u));
}

.tt-outcome__line {
  max-width: var(--tt-copy-width);
  margin-top: calc(8 * var(--u));
  font-family: var(--font-body);
  font-size: var(--tt-lead-size);
  line-height: 1.35;
}

.tt-outcome__value {
  font-family: var(--font-display);
  font-size: var(--tt-outcome-size);
  line-height: 1;
}

.tt-outcome .tt-note {
  margin-top: calc(10 * var(--u));
}

/* ---------- Pain points & solutions ---------- */

.tt-pains__list {
  margin-top: calc(14 * var(--u));
  font-family: var(--font-body);
}

.tt-pain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(48 * var(--u)) minmax(0, 1fr);
  align-items: baseline;
  padding: calc(18 * var(--u)) 0;
  border-top: var(--pf-rule) solid currentColor;
}

.tt-pain:last-child {
  border-bottom: var(--pf-rule) solid currentColor;
}

.tt-pain__kind {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--tt-caption-size);
  line-height: 1.5;
}

.tt-pain__text {
  margin-top: calc(4 * var(--u));
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.tt-pain__solution .tt-pain__text {
  font-weight: 600;
}

.tt-pain__arrow {
  align-self: center;
  font-family: var(--font-mono);
  font-size: var(--pf-meta-size);
  text-align: center;
}

/* ---------- Related research ---------- */

.tt-research__list {
  display: grid;
  grid-template-columns: repeat(var(--tt-columns), minmax(0, 1fr));
  column-gap: var(--pf-grid-gap);
  row-gap: calc(40 * var(--u));
  margin-top: calc(14 * var(--u));
}

.tt-research__item {
  padding-top: calc(20 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.tt-research__number {
  font-family: var(--font-display);
  font-size: var(--tt-number-size);
  line-height: 1;
  font-kerning: normal;
}

.tt-research__text {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
  text-wrap: pretty;
}

.tt-research__source {
  margin-top: calc(6 * var(--u));
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--tt-caption-size);
  line-height: 1.45;
}

.tt-source {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  font-family: var(--font-mono);
  font-style: normal;
  transition: opacity 0.2s var(--ease);
}

.tt-source__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.tt-source:hover {
  opacity: 0.6;
}

.tt-research__implication {
  margin-top: calc(14 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.tt-research__implication strong {
  font-weight: 600;
}

/* ---------- Prototype video ---------- */

.tt-video {
  margin-top: var(--tt-gap-block);
}

.pf .tt-video__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--pf-goal-size);
  line-height: 1.2;
}

.tt-video__frame {
  margin-top: calc(16 * var(--u));
  background: var(--pf-ink);
}

.tt-video__media {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Core features ---------- */

.tt-feature {
  margin-top: var(--tt-gap-section);
}

.pf .tt-feature__title {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--pf-goal-size);
  line-height: 1.2;
}

.tt-feature__text {
  margin-top: calc(12 * var(--u));
}

.tt-feature__lead,
.tt-sequence {
  margin-top: var(--tt-gap-media);
}

/* capture -> submit -> confirmed */
.tt-sequence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tt-row-gap);
}

.tt-sequence + .tt-row {
  margin-top: calc(40 * var(--u));
}

.tt-sequence__index {
  font-family: var(--font-mono);
  font-style: normal;
}

/* ---------- Closing ---------- */

.pf .tt-closing__line {
  font-family: var(--font-body);
  font-weight: 700;
  font-style: italic;
  font-size: var(--tt-headline-size);
  line-height: 1.25;
  text-wrap: balance;
}

.tt-closing__pair {
  margin-top: var(--tt-gap-media);
}

/* ---------- Tablet + mobile (below 1180px) ---------- */
@media (max-width: 1179.98px) {
  :root {
    --tt-gap-section: 88px;
    --tt-gap-block: 52px;
    --tt-gap-title: 14px;
    --tt-gap-media: 24px;
    --tt-row-gap: 12px;
    --tt-label-size: 13px;
    --tt-title-size: 30px;
    --tt-headline-size: 24px;
    --tt-lead-size: 17px;
    --tt-number-size: 52px;
    --tt-outcome-size: 44px;
    --tt-caption-size: 12px;
    --tt-small-width: 55%;
  }

  .tt-pain {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  }
}

/* ---------- Mobile (599px and below) ---------- */
@media (max-width: 599.98px) {
  :root {
    --tt-gap-section: 72px;
    --tt-gap-block: 44px;
    --tt-title-size: 25px;
    --tt-headline-size: 21px;
    --tt-lead-size: 16px;
    --tt-number-size: 44px;
    --tt-outcome-size: 40px;
    --tt-small-width: 100%;
    --tt-columns: 1;
  }

  /* everything in one column; screens keep their proportions */
  .tt-row {
    flex-direction: column;
    gap: 24px;
  }

  .tt-row__item {
    flex: none !important;
    width: 100%;
  }

  .tt-sequence {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  /* pain point above its solution, with a down arrow between */
  .tt-pain {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
  }

  .tt-pain__arrow {
    text-align: left;
    transform: rotate(90deg);
    width: 1em;
  }

  .tt-overview__facts .snapshot__row {
    flex-wrap: wrap;
  }
}
