/*
 * SAINO site styles.
 *
 * Every value comes from tokens.css; no colour literals live here, and
 * tools/lint_tokens.py fails the build if one appears. Vermilion is referenced
 * exactly once, on .btn-primary.
 */

/* ---------------------------------------------------------------- reset */

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Inter, "Noto Sans JP", "Noto Sans TC", system-ui, sans-serif;
  font-size: var(--base);
  line-height: var(--lh-base);
  font-feature-settings: "palt" 1;
}

/* Japanese copy needs a looser line height than Latin. */
body.saino-cjk-loose { line-height: var(--lh-ja); }

img, svg { max-width: 100%; height: auto; }

a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
  color: var(--indigo);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  margin: 0 0 0.6em;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: 1rem; }

p { margin: 0 0 1.2em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }

/* ------------------------------------------------------------- layout */

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.section { padding-block: 72px; }
.section--paper { background: var(--paper); }
.section--tight { padding-block: 48px; }

.grid {
  display: grid;
  gap: var(--gutter);
}

.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid--4 { grid-template-columns: 1fr; }
  .section { padding-block: 48px; }
  :root { --h1: 30px; --h2: 23px; --h3: 18px; }
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: var(--gutter);
  z-index: 100;
  padding: 0.6em 1em;
  background: var(--white);
  border: 1px solid var(--indigo);
}

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  transition: height 0.2s ease;
}

.site-header.is-scrolled { height: var(--header-h-scrolled); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--gutter);
  width: min(100% - (var(--gutter) * 2), var(--container));
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  flex: 0 0 auto;
}

/* Provisional wordmark spec from IG R1: Inter 600, +0.16em tracking, indigo.
   The final logo is not signed off (C-07), so this stays swappable. */
.wordmark__mark {
  font-weight: var(--weight-semibold);
  font-size: 22px;
  letter-spacing: var(--tracking-wordmark);
  color: var(--indigo);
  line-height: 1;
}

.wordmark__legal {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  line-height: 1;
}

.site-nav { flex: 1 1 auto; }

.site-nav__list {
  display: flex;
  gap: 1.6em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.site-nav__list a { text-decoration: none; }
.site-nav__list a:hover { text-decoration: underline; }

.site-header__aside {
  display: flex;
  align-items: center;
  gap: 1.2em;
  flex: 0 0 auto;
}

.lang-switch {
  display: flex;
  gap: 0.8em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.lang-switch a { color: var(--ink-mute); text-decoration: none; }
.lang-switch a:hover { text-decoration: underline; }
.lang-switch__item.is-current a { color: var(--indigo); font-weight: var(--weight-medium); }

@media (max-width: 900px) {
  .site-header { height: auto; padding-block: 12px; position: static; }
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; order: 3; }
  .site-nav__list { flex-wrap: wrap; gap: 1em; }
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-block;
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  border: 1px solid var(--indigo);
  font-size: 15px;
  font-weight: var(--weight-medium);
  text-decoration: none;
  line-height: 1.4;
  cursor: pointer;
  background: transparent;
  color: var(--indigo);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--indigo); color: var(--white); }

/*
 * The single vermilion element on the site. IG R1 caps vermilion at 10% of the
 * palette and names the primary CTA as its only carrier; tools/lint_tokens.py
 * rejects any other selector that references the token.
 */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--white);
}

.btn-primary:hover { background: var(--vermilion-deep); border-color: var(--vermilion-deep); }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- hero */

/*
 * The measurement field is an SVG asset, not a CSS gradient: IG allows white and
 * 生成り alternating with no third background and no gradients, so the colour
 * stays a token and the lines live in the file. Its left 42% is empty by
 * construction, which is where the headline sits.
 */
.hero {
  padding-block: 96px 72px;
  background-color: var(--paper);
  background-image: url(../img/hero-field.svg);
  background-repeat: no-repeat;
  background-position: center right;
  background-size: cover;
}

/*
 * Brand photograph heroes.
 *
 * These are the only dark surfaces on the site. They sit outside the white and
 * 生成り alternation rather than breaking it: the alternation governs the
 * content sections, and the hero is a full-bleed band above them.
 *
 * The scrim is a flat overlay, not a gradient, and its opacity is the same value
 * tools/make_hero_images.py assumes when it measures white-on-image contrast in
 * the text zone. Change one and the other stops being a guarantee.
 *
 * The frames are brand atmosphere. Nothing in them is an identifiable SAINO
 * part, so they claim nothing a supplier audit could read as evidence.
 */
.hero--image {
  position: relative;
  padding-block: 132px 112px;
  background-color: var(--indigo-deep);
  background-image: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--on-dark);
  isolation: isolate;
}

.hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--indigo);
  opacity: var(--hero-scrim);
  z-index: -1;
}

.hero--image .hero__slogan,
.hero--image .hero__title,
.hero--image .page-title { color: var(--on-dark); }

.hero--image .hero__slogan-en,
.hero--image .hero__lead { color: var(--on-dark-mute); }

.hero--image .btn {
  color: var(--on-dark);
  border-color: var(--rule-on-dark);
}

/* The primary CTA keeps vermilion. It is still the only vermilion element. */

.hero--brand-home {
  background-image: image-set(url(../img/brand-home-1600.webp) type("image/webp"),
                              url(../img/brand-home-1600.jpg) type("image/jpeg"));
}
.hero--brand-quality {
  background-image: image-set(url(../img/brand-quality-1600.webp) type("image/webp"),
                              url(../img/brand-quality-1600.jpg) type("image/jpeg"));
}
.hero--brand-about {
  background-image: image-set(url(../img/brand-about-1600.webp) type("image/webp"),
                              url(../img/brand-about-1600.jpg) type("image/jpeg"));
}

@media (min-width: 1400px) {
  .hero--brand-home {
    background-image: image-set(url(../img/brand-home-2400.webp) type("image/webp"),
                                url(../img/brand-home-2400.jpg) type("image/jpeg"));
  }
  .hero--brand-quality {
    background-image: image-set(url(../img/brand-quality-2400.webp) type("image/webp"),
                                url(../img/brand-quality-2400.jpg) type("image/jpeg"));
  }
  .hero--brand-about {
    background-image: image-set(url(../img/brand-about-2400.webp) type("image/webp"),
                                url(../img/brand-about-2400.jpg) type("image/jpeg"));
  }
}

.hero__title { font-size: clamp(30px, 4vw, 46px); margin-bottom: 0.4em; }
.hero__lead { max-width: 46em; color: var(--ink-mute); }
.hero__actions { margin-top: 2em; }

/* Slogan. Four CJK characters need their own scale to hold the hero, and the
   wordmark's tracking to read as brand rather than as a heading. */
.hero__slogan {
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wordmark);
  line-height: 1.25;
  color: var(--indigo);
  margin: 0;
}

.hero__slogan-en {
  margin: 0.5em 0 0;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wordmark);
  text-transform: lowercase;
  color: var(--ink-mute);
}

.hero__slogan + .hero__slogan-en + .hero__lead { margin-top: 1.6em; }

/* --------------------------------------------------------------- cards */

.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.card__title { margin: 0; font-size: var(--h3); }
.card__body { color: var(--ink-mute); font-size: 15px; margin: 0; flex: 1 1 auto; }
.card__link { font-size: 14px; text-decoration: none; }
.card__link::after { content: " \2192"; }

/* --------------------------------------------------------------- table */

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  /* Specification figures must line up column to column. */
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--rule);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: var(--paper);
  color: var(--indigo);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.data-table td.is-numeric { text-align: right; }
.data-table tbody tr:hover { background: var(--paper); }

.spec-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.7;
}

/* ------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 20px;
  background: var(--paper);
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.filters__field { display: flex; flex-direction: column; gap: 6px; }
.filters__label { font-size: 13px; color: var(--ink-mute); }

.filters select {
  min-width: 12em;
  padding: 0.5em 0.6em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.result-count { font-size: 14px; color: var(--ink-mute); margin-bottom: 12px; }

/* ---------------------------------------------------------- placeholder */

/*
 * Unconfirmed content, carried over from the prototype's amber treatment.
 * Keeping it visible on staging turns the open-items list into something you can
 * see, and makes it obvious if one ever reaches production.
 */
.ph {
  background: var(--placeholder-bg);
  border-bottom: 1px dashed var(--placeholder-rule);
  color: var(--placeholder-ink);
  padding: 0 0.3em;
}

.ph__label {
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-right: 0.5em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------- breadcrumb */

.breadcrumb { padding-block: 20px 0; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-mute);
}

.breadcrumb__item + .breadcrumb__item::before { content: "/"; margin-right: 0.5em; }
.breadcrumb a { color: var(--ink-mute); }

/* ---------------------------------------------------------------- news */

.news-list { list-style: none; margin: 0; padding: 0; }

.news-list__item {
  display: flex;
  gap: 1.5em;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.news-list__date { color: var(--ink-mute); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-list__title { text-decoration: none; }

@media (max-width: 600px) {
  .news-list__item { flex-direction: column; gap: 0.3em; }
}

/* ---------------------------------------------------------------- form */

.form { max-width: 46em; }
.form__group { border: 0; padding: 0; margin: 0 0 32px; }
.form__group[hidden] { display: none; }

.form__legend {
  font-size: var(--h3);
  color: var(--indigo);
  font-weight: var(--weight-medium);
  padding: 0;
  margin-bottom: 16px;
}

.form__row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form__label { font-size: 14px; color: var(--ink); }
.form__required { color: var(--ink-mute); margin-left: 0.3em; }

.form__input {
  padding: 0.6em 0.7em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  width: 100%;
}

.form__input:focus-visible { outline: 2px solid var(--indigo); outline-offset: 1px; }
.form__hint { font-size: 12px; color: var(--ink-mute); }
.form__error:not(:empty) { font-size: 13px; color: var(--placeholder-ink); }
.form__consent { display: flex; gap: 0.6em; align-items: flex-start; font-size: 14px; }

.form__status {
  padding: 14px 16px;
  margin-bottom: 24px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  color: var(--teal);
  font-size: 15px;
}

.form__status--error { border-color: var(--placeholder-rule); color: var(--placeholder-ink); }

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

.site-footer {
  background: var(--indigo);
  color: var(--white);
  padding-block: 56px 24px;
  margin-top: 80px;
}

.site-footer a { color: var(--white); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: space-between;
  padding-bottom: 32px;
}

.wordmark__mark--footer { color: var(--white); font-size: 20px; display: block; margin-bottom: 12px; }
.site-footer__legal { margin: 0 0 8px; font-size: 15px; }
.site-footer__address { font-style: normal; font-size: 14px; line-height: 1.9; opacity: 0.85; }

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--indigo-deep);
  padding-top: 20px;
  font-size: 13px;
}

.site-footer__copyright { margin: 0; opacity: 0.8; }
.site-footer .lang-switch a { color: var(--white); opacity: 0.85; }

/* --------------------------------------------------------------- prose */

.prose { max-width: 46em; }
.prose h2 { margin-top: 2em; }

/*
 * When .prose sits on the same element as .wrap, the 46em measure collides with
 * .wrap's own margin: 0 auto and the whole block gets centred in the container.
 * That was self-consistent while the page title lived inside it; once the title
 * moved up into the hero, the title sat on the container edge and the body text
 * floated in the middle of the page.
 *
 * Keep the element behaving as the container and put the measure on its
 * children, so the text starts where every other section starts.
 */
.wrap.prose { max-width: var(--container); }
.wrap.prose > * { max-width: 46em; }
.page-title { margin-bottom: 0.8em; }

.definition-list { margin: 0; }
.definition-list__row { display: flex; gap: 1.5em; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.definition-list__term { flex: 0 0 12em; color: var(--ink-mute); font-size: 14px; margin: 0; }
.definition-list__value { margin: 0; font-size: 15px; }

@media (max-width: 600px) {
  .definition-list__row { flex-direction: column; gap: 0.3em; }
}

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps__item { counter-increment: step; display: flex; gap: 1em; align-items: flex-start; }

.steps__item::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 2em;
  height: 2em;
  display: grid;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Business-line label. IG R1 section 04: teal, medium weight, product level. */
.line-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--teal);
  letter-spacing: 0.04em;
  margin-bottom: 0.6em;
}

.status-tag {
  display: inline-block;
  font-size: 12px;
  padding: 0.15em 0.6em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-mute);
  white-space: nowrap;
}
