/* ===========================================================================
   Tessen — company page
   ---------------------------------------------------------------------------
   Loaded after assets/css/tessen.css. That order matters more than it looks:
   @media raises no specificity, so an unscoped re-declaration of a shared
   component class here would beat that sheet's own breakpoints and the mobile
   collapse would silently never happen. Every rule below is therefore scoped
   to .page-company, and where a rule takes over a property the shared sheet
   varies by width, the breakpoint is written out again in this file.

   Colours resolve through --sf-* only, so each block follows the tone its
   section declares. No hex values live here.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. Crest — the small hero. A page title and one paragraph; the metric panel
   belongs to the index and is deliberately absent.
   --------------------------------------------------------------------------- */
.page-company .ts-crest {
  padding-top: 132px;
  padding-bottom: 72px;
  overflow: hidden;
}

.page-company .ts-crest__stated {
  display: grid;
  gap: 24px;
  align-content: start;
  max-width: 70ch;
}

.page-company .ts-crest__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--sf-line);
}

/* ---------------------------------------------------------------------------
   2. Story — a reading section with a fact sheet beside it. Density is the
   axis this page sits on, so the facts are ruled cells rather than prose.
   --------------------------------------------------------------------------- */
.page-company .ts-story__block {
  padding-block: 48px;
  border-top: 1px solid var(--sf-line);
}
.page-company .ts-story__block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.page-company .ts-story__body {
  display: grid;
  gap: 36px;
  align-items: start;
}

.page-company .ts-story__prose {
  display: grid;
  gap: 20px;
  max-width: 62ch;
}

.page-company .ts-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--sf-line);
  border: 1px solid var(--sf-line);
}
.page-company .ts-facts__cell {
  background: var(--sf-bg);
  padding: 16px 18px 18px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.page-company .ts-facts__key {
  font-family: var(--ts-font-mono);
  font-size: var(--ts-fs-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-accent);
}
.page-company .ts-facts__value {
  font-size: var(--ts-fs-4);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* the entity diagram sits under the facts, same width, same ruled edge */
.page-company .ts-story__plate {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--sf-line);
  border-top: 0;
  background: var(--sf-panel);
}

/* ---------------------------------------------------------------------------
   3. Vow — the three standing rules. A claim on the left, what it costs us on
   the right. Ruled rows, no cards.
   --------------------------------------------------------------------------- */
.page-company .ts-vow { display: grid; }

.page-company .ts-vow__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 24px 0 26px;
  border-top: 1px solid var(--sf-line);
}
.page-company .ts-vow__item:last-child { border-bottom: 1px solid var(--sf-line); }

.page-company .ts-vow__claim {
  font-family: var(--ts-font-display);
  font-size: clamp(var(--ts-fs-4), 1.7vw, var(--ts-fs-5));
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.32;
  text-wrap: pretty;
}
.page-company .ts-vow__note {
  font-size: var(--ts-fs-3);
  line-height: 1.68;
  color: var(--sf-muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   4. Eras — the history. Rows on a rule, a year in the mono face, and an
   accent bar that draws down the left edge of whichever row is being read.
   --------------------------------------------------------------------------- */
.page-company .ts-eras { display: grid; }

/* The narrow layout needs its own named areas, not just a single column: the
   children below are placed by name, and a name with no matching line makes
   every implicit line answer to it — which stacks all four into one cell. */
.page-company .ts-era {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "year kind"
    "name name"
    "note note";
  column-gap: 14px;
  row-gap: 8px;
  align-items: baseline;
  padding: 22px 0 24px 18px;
  border-top: 1px solid var(--sf-line);
  transition: background var(--ts-dur-micro) var(--ts-ease);
}
.page-company .ts-era:last-child { border-bottom: 1px solid var(--sf-line); }

/* scaled rather than sized: the bar animates on transform only */
.page-company .ts-era::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: 0;
  width: 2px;
  background: var(--sf-accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.45s var(--ts-ease);
}
.page-company .ts-era:hover::before,
.page-company .ts-era:focus-within::before { transform: scaleY(1); }
.page-company .ts-era:hover { background: var(--sf-panel); }

.page-company .ts-era__year {
  grid-area: year;
  font-family: var(--ts-font-mono);
  font-size: clamp(var(--ts-fs-5), 2vw, var(--ts-fs-6));
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--sf-accent);
}
.page-company .ts-era__kind {
  grid-area: kind;
  font-family: var(--ts-font-mono);
  font-size: var(--ts-fs-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.page-company .ts-era__name {
  grid-area: name;
  font-family: var(--ts-font-display);
  font-size: var(--ts-fs-5);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
}
.page-company .ts-era__note {
  grid-area: note;
  font-size: var(--ts-fs-3);
  line-height: 1.65;
  color: var(--sf-muted);
  max-width: 54ch;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   5. Crew — role cards. The plate carries the role at rest and opens to the
   responsibility on hover; the card height never changes, so the grid holds.
   Every portrait here is a placeholder slot for the buyer's own team.
   --------------------------------------------------------------------------- */
.page-company .ts-crew {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.page-company .ts-crew__card {
  position: relative;
  border: 1px solid var(--sf-line);
  background: var(--sf-panel);
  overflow: hidden;
  transition: border-color var(--ts-dur-micro) var(--ts-ease);
}
.page-company .ts-crew__card:hover,
.page-company .ts-crew__card:focus-visible { border-color: var(--sf-accent); }

.page-company .ts-crew__shot { position: relative; display: block; }
.page-company .ts-crew__shot img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.page-company .ts-crew__plate {
  display: grid;
  gap: 6px;
  padding: 16px 16px 18px;
  background: var(--sf-ink);
  border-top: 1px solid var(--sf-accent);
  color: var(--sf-fg);
}

.page-company .ts-crew__slot {
  font-family: var(--ts-font-mono);
  font-size: var(--ts-fs-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.page-company .ts-crew__role {
  font-family: var(--ts-font-display);
  font-size: var(--ts-fs-4);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* the fold is the same row-collapse the FAQ uses, so the page has one
   opening gesture rather than two that nearly match */
.page-company .ts-crew__fold {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.45s var(--ts-ease);
}
.page-company .ts-crew__foldinner { overflow: hidden; }
.page-company .ts-crew__note {
  font-size: var(--ts-fs-2);
  line-height: 1.6;
  color: var(--sf-muted);
  padding-top: 8px;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   6. Posts — open positions. Same ruled row as the history above; the whole
   row is the link, and it lands on the form.
   --------------------------------------------------------------------------- */
.page-company .ts-posts { display: grid; }

/* Named areas at every width, for the reason given above the history rows. */
.page-company .ts-post {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name  name"
    "team  terms"
    "where where";
  column-gap: 16px;
  row-gap: 6px;
  min-height: 64px;
  padding: 20px 0 22px 18px;
  border-top: 1px solid var(--sf-line);
  color: inherit;
  text-decoration: none;
  transition: background var(--ts-dur-micro) var(--ts-ease);
}
.page-company .ts-post:last-of-type { border-bottom: 1px solid var(--sf-line); }
.page-company .ts-post::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: 0;
  width: 2px;
  background: var(--sf-accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.45s var(--ts-ease);
}
.page-company .ts-post:hover::before,
.page-company .ts-post:focus-visible::before { transform: scaleY(1); }
.page-company .ts-post:hover { background: var(--sf-panel); }

.page-company .ts-post__name {
  grid-area: name;
  font-family: var(--ts-font-display);
  font-size: clamp(var(--ts-fs-4), 1.7vw, var(--ts-fs-5));
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.page-company .ts-post__team { grid-area: team; }
.page-company .ts-post__where { grid-area: where; }
.page-company .ts-post__terms { grid-area: terms; }
.page-company .ts-post__team,
.page-company .ts-post__where,
.page-company .ts-post__terms {
  font-family: var(--ts-font-mono);
  font-size: var(--ts-fs-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-muted);
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   7. Apply — the form. It declares its own tone, so the header adopts it on
   the way past and the surface set flips for everything inside.
   --------------------------------------------------------------------------- */
.page-company .ts-apply {
  margin-top: 56px;
  padding: 36px 24px 40px;
  background: var(--sf-bg);
  color: var(--sf-fg);
  border: 1px solid var(--sf-line);
}

.page-company .ts-apply__grid {
  display: grid;
  gap: 36px;
  align-items: start;
}

.page-company .ts-apply__stated {
  display: grid;
  gap: 16px;
  align-content: start;
  max-width: 46ch;
}

.page-company .ts-apply__form { display: grid; gap: 18px; }
.page-company .ts-apply__pair { display: grid; gap: 18px; }
.page-company .ts-apply__field { display: grid; gap: 8px; }

/* the label carries full contrast: at twelve pixels in the mono face, muted
   grey is legible on a page and marginal on a form */
.page-company .ts-apply__label {
  font-family: var(--ts-font-mono);
  font-size: var(--ts-fs-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-fg);
}
.page-company .ts-apply__optional { color: var(--sf-muted); }

.page-company .ts-apply__control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--sf-line);
  border-radius: var(--ts-radius-1);
  background: var(--sf-panel);
  color: var(--sf-fg);
  font-family: var(--ts-font-body);
  font-size: var(--ts-fs-3);
  line-height: 1.5;
  transition: border-color var(--ts-dur-micro) var(--ts-ease);
}
.page-company .ts-apply__control::placeholder { color: var(--sf-muted); }
.page-company .ts-apply__control:hover { border-color: var(--sf-muted); }
/* focus paints an outline, never a border: a border swap would shift layout */
.page-company .ts-apply__control:focus-visible {
  outline: 2px solid var(--sf-accent);
  outline-offset: 2px;
  border-color: var(--sf-accent);
}
/* the palette has one accent and spending a second on a warning would break
   it, so a rejected field carries weight and a rule instead of a colour */
.page-company .ts-apply__control[aria-invalid="true"] {
  border-color: var(--sf-fg);
  box-shadow: inset 2px 0 0 var(--sf-fg);
}
.page-company .ts-apply__control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-company textarea.ts-apply__control {
  min-height: 132px;
  resize: vertical;
}

.page-company .ts-apply__select { position: relative; display: grid; }
.page-company .ts-apply__select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
}
.page-company .ts-apply__select::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 1.5px solid var(--sf-muted);
  border-bottom: 1.5px solid var(--sf-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.page-company .ts-apply__send { margin-top: 4px; }
.page-company .ts-apply__send .ts-btn { will-change: transform; }

/* ---------------------------------------------------------------------------
   8. Footer. The block is copied from the index without change; the one
   difference is that its blurb measure lives here as a class rather than an
   inline style. Same values, so the two footers render identically.
   --------------------------------------------------------------------------- */
.page-company .ts-foot__blurb {
  margin-top: 16px;
  max-width: 34ch;
}

/* ---------------------------------------------------------------------------
   Responsive. The shared sheet splits at 700 and 1000; this page keeps those
   two seams rather than inventing a third.
   --------------------------------------------------------------------------- */
@media (min-width: 700px) {
  .page-company .ts-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-company .ts-crew { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-company .ts-crew__shot img { aspect-ratio: 4 / 5; }

  .page-company .ts-era {
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-areas:
      "year name"
      "year note"
      "kind note";
    column-gap: 24px;
    row-gap: 8px;
  }

  .page-company .ts-post {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name  terms"
      "team  where";
    column-gap: 24px;
    align-items: baseline;
  }
  .page-company .ts-post__terms { justify-self: end; }
  .page-company .ts-post__where { justify-self: end; text-align: right; }
}

@media (min-width: 1000px) {
  .page-company .ts-crest {
    padding-top: 168px;
    padding-bottom: 96px;
  }

  .page-company .ts-story__block { padding-block: 56px; }
  .page-company .ts-story__body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
  }

  .page-company .ts-vow__item {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: 48px;
    align-items: start;
  }

  .page-company .ts-era {
    grid-template-columns: 116px minmax(0, 4fr) minmax(0, 6fr);
    grid-template-areas:
      "year name note"
      "year kind note";
    column-gap: 32px;
    row-gap: 6px;
    align-items: start;
    padding: 26px 0 28px 20px;
  }
  .page-company .ts-era__note { align-self: start; }

  .page-company .ts-crew { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

  /* from here up the plate rides the portrait and the note is held back for
     the pointer; below this width it stays in the flow and stays open */
  .page-company .ts-crew__plate {
    position: absolute;
    inset: auto 0 0 0;
  }
  .page-company .ts-crew__fold { grid-template-rows: 0fr; }
  .page-company .ts-crew__card:hover .ts-crew__fold,
  .page-company .ts-crew__card:focus-within .ts-crew__fold,
  .page-company .ts-crew__card:focus-visible .ts-crew__fold { grid-template-rows: 1fr; }

  .page-company .ts-post {
    grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas: "name team where terms";
    column-gap: 32px;
    align-items: baseline;
    padding: 22px 0 24px 20px;
  }
  .page-company .ts-post__where { justify-self: start; text-align: left; }
  .page-company .ts-post__terms { justify-self: end; }

  .page-company .ts-apply {
    margin-top: 64px;
    padding: 48px 44px 52px;
  }
  .page-company .ts-apply__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 64px;
  }
  .page-company .ts-apply__pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The shared sheet drops --ts-space-lg to 84px here. The crest sets its own
   padding, so it has to answer the same breakpoint itself. */
@media (max-width: 699px) {
  .page-company .ts-crest {
    padding-top: 108px;
    padding-bottom: 56px;
  }
  .page-company .ts-story__block { padding-block: 40px; }
  .page-company .ts-apply { margin-top: 40px; padding: 28px 18px 32px; }
  .page-company .ts-era { padding: 20px 0 22px 16px; }
  .page-company .ts-post { padding: 18px 0 20px 16px; }
}

/* ---------------------------------------------------------------------------
   Reduced motion. The shared sheet already flattens durations; what it cannot
   know is that the crew note is hover-held on wide screens. Open it.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .page-company .ts-era::before,
  .page-company .ts-post::before { transform: scaleY(1); }
  .page-company .ts-crew__fold { grid-template-rows: 1fr; }
}
