/* FlameNut — flamenut.com
   Shared stylesheet for / (English) and /ja/ (Japanese).
   One ruled sheet: kinari paper, sumi ink and a shu (vermilion) register.
   Static HTML and CSS only: no scripts, no remote assets. */


/* Fonts
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Manrope";
  src: url("/manrope-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/manrope-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Windows renders Yu Gothic Regular too thin on screen, so 400 maps to Medium. */
@font-face {
  font-family: "FlameNut Yu Gothic";
  src: local("Yu Gothic Medium"), local("YuGothic-Medium");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "FlameNut Yu Gothic";
  src: local("Yu Gothic Bold"), local("YuGothic-Bold");
  font-weight: 700;
  font-style: normal;
}


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

:root {
  color-scheme: light;

  --paper: #f6f3ec;        /* canvas and theme-color */
  --paper-deep: #ede8dd;   /* contact and footer */
  --white: #ffffff;
  --ink: #1b1a17;
  --ink-soft: #524e46;     /* 7.4:1 on paper, 6.7:1 on paper-deep */
  --rule: #d5cfc3;
  --rule-deep: #cbc3b4;
  --frame: rgba(27, 26, 23, 0.16);
  --shu: #b93824;          /* the red F */
  --shu-deep: #942a19;

  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Manrope", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "FlameNut Yu Gothic", "Yu Gothic", YuGothic, "Noto Sans JP", "Noto Sans CJK JP", Meiryo, sans-serif;

  --gutter: 18px;
  --gap: 48px;
}


/* Base
   ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  scroll-padding-top: 12px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Japanese text, including Japanese words inside the English page. */
:lang(ja) {
  font-family: var(--font-ja);
  line-break: strict;
  word-break: keep-all;
}

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

h1,
h2,
h3,
h4 {
  font-weight: 700;
  text-wrap: balance;
}

p,
dd {
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid var(--shu);
  outline-offset: 3px;
}

.phrase {
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip,
.skip:hover {
  color: var(--white);
}

.skip:focus {
  transform: none;
}

.wrap {
  width: calc(100% - 2 * var(--gutter));
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}


/* Header
   ------------------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 10;
  border-top: 3px solid var(--shu);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

/* Phones: brand and language on the first row, sections on the second. */
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand language"
    "nav   nav";
  align-items: center;
  padding-top: 4px;
  padding-bottom: 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-inner .brand {
  grid-area: brand;
  justify-self: start;
}

.mark {
  flex: none;
  width: 28px;
  height: 28px;
  margin-right: 10px;
}

.main-nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.language-nav {
  grid-area: language;
  display: flex;
  margin-right: -10px;
}

.language-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.language-nav a + a::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  border-left: 1px solid var(--rule);
}

.language-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--shu);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}


/* Masthead
   ------------------------------------------------------------------ */

.masthead {
  padding-top: 28px;
  padding-bottom: 32px;
}

.masthead h1 {
  font-size: clamp(1.875rem, 1rem + 3vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.032em;
}

.masthead-text {
  max-width: 32em;
  margin-top: 16px;
}


/* Sections
   ------------------------------------------------------------------ */

/* A 2px sumi rule opens each major section, aligned to the content edges. */
.products > .wrap,
.about > .wrap {
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}

.products,
.about {
  padding-bottom: 64px;
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.products .section-title {
  margin-bottom: 24px;
}

.list-title {
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.45;
}

.lead {
  max-width: 32em;
  margin-top: 20px;
  font-size: 1.0625rem;
  line-height: 1.6;
}


/* Products
   ------------------------------------------------------------------ */

.product-index {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 24px;
}

.products .product-index .section-title {
  margin-bottom: 0;
}

.product-index nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

.product-index a,
.store-link {
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 700;
}

.product-index a {
  display: inline-block;
  padding: 10px 0;
}

.metaform {
  display: grid;
  align-items: start;
  gap: 28px;
  margin-top: clamp(3rem, 6vw, 5.5rem);
  padding-top: clamp(2rem, 4vw, 3.75rem);
  border-top: 1px solid var(--ink);
}

.series-label {
  display: inline-block;
  font-size: 0.48em;
  letter-spacing: 0;
}

.series-intro .lead {
  max-width: 28em;
  margin-top: 14px;
}

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

.app-list li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0 16px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.app-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.app-list img {
  width: 100%;
  border-radius: 22%;
}

.app-copy h4 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.app-copy p {
  margin-top: 4px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.store-link {
  display: inline-flex;
  align-items: center;
  grid-column: 2;
  justify-self: start;
  color: var(--shu-deep);
}

@media (min-width: 641px) {
  .app-list li {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    column-gap: 20px;
  }

  .store-link {
    grid-column: 3;
    align-self: center;
  }
}

@media (min-width: 960px) {
  .metaform {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--gap);
  }

  .series-intro .lead {
    max-width: 21em;
  }
}

.product-name {
  font-size: clamp(2.25rem, 1.7rem + 1.6vw, 3.125rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.product-kind {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
}

.platforms figure {
  display: flex;
  align-items: center;
}

.platforms img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--frame);
  border-radius: 22%;
  background: var(--white);
  object-fit: contain;
}

.platforms .icon-inset {
  padding: 4px;
}

.platforms figcaption {
  margin-left: 8px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* Screenshots are shown whole, at their native 1440 × 1000 ratio. */
.shot {
  margin-top: 20px;
}

.shot img {
  width: 100%;
  border: 1px solid var(--frame);
  background: var(--white);
}

.shot figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}


/* Actions
   ------------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

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

.btn-line {
  background: transparent;
  color: var(--ink);
}

.btn-shu {
  border-color: var(--shu);
  background: var(--shu);
  color: var(--white);
}

.btn-shu:focus-visible {
  outline-color: var(--ink);
}


/* Ledgers: hairline-ruled term and description lists
   ------------------------------------------------------------------ */

.ledger > div {
  padding: 14px 0 16px;
  border-top: 1px solid var(--rule);
}

.ledger dt {
  font-weight: 700;
  line-height: 1.45;
}

.ledger dd {
  max-width: 36em;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.features,
.tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.features {
  margin-top: 32px;
}


/* OtoMado, a tool within Deaf Navi
   ------------------------------------------------------------------ */

.tool {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.tool-name {
  font-size: clamp(1.875rem, 1.5rem + 1.1vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.kana {
  color: var(--ink-soft);
  font-size: 0.55em;
  letter-spacing: 0.04em;
}

.tool .lead {
  font-size: 1rem;
}

.tools {
  margin-top: 24px;
}

/* The safety limitation is set in ink with a shu rule, never as fine print. */
.note {
  max-width: 36em;
  margin-top: 24px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--shu);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}


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

.about .lead {
  margin-top: 14px;
}

.about-work {
  margin-top: 36px;
}


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

.contact {
  --rule: var(--rule-deep);
  padding-top: 40px;
  padding-bottom: 56px;
  border-top: 2px solid var(--shu);
  background: var(--paper-deep);
}

.contact-main p {
  max-width: 32em;
  margin-top: 14px;
}

.mail {
  min-height: 56px;
  padding: 12px 24px;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact-guide {
  margin-top: 40px;
}


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

.site-footer {
  --rule: var(--rule-deep);
  background: var(--paper-deep);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 24px;
  padding-top: 12px;
  padding-bottom: 24px;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}

.footer-inner .brand {
  font-size: 1rem;
}

.footer-inner .mark {
  width: 22px;
  height: 22px;
  margin-right: 8px;
}

.footer-inner p,
.footer-inner small {
  color: var(--ink-soft);
  font-size: inherit;
}

.footer-inner p {
  order: 1;
  flex-basis: 100%;
}

.footer-inner small {
  margin-left: auto;
}


/* Japanese
   Phrase breaks come from <wbr> in the markup, held by word-break: keep-all.
   ------------------------------------------------------------------ */

html:lang(ja) body {
  line-height: 1.85;
}

html:lang(ja) .masthead h1 {
  font-size: clamp(1.5rem, 0.95rem + 2.5vw, 2.75rem);
  line-height: 1.42;
  letter-spacing: 0.01em;
  font-feature-settings: "palt";
}

html:lang(ja) .section-title {
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-feature-settings: "palt";
}

html:lang(ja) .list-title,
html:lang(ja) .ledger dt {
  line-height: 1.5;
  letter-spacing: 0.02em;
}

html:lang(ja) .masthead-text,
html:lang(ja) .lead,
html:lang(ja) .contact-main p {
  max-width: 30em;
  line-height: 1.85;
  letter-spacing: 0.02em;
}

html:lang(ja) .lead {
  font-size: 1rem;
}

html:lang(ja) .product-kind,
html:lang(ja) .shot figcaption {
  letter-spacing: 0.02em;
}

html:lang(ja) .ledger dd {
  max-width: 34em;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

html:lang(ja) .note {
  line-height: 1.75;
}

html:lang(ja) .main-nav a {
  font-size: 0.875rem;
}

html:lang(ja) .kana {
  color: var(--ink);
}


/* Hover, for pointer devices only so touch screens never keep a stuck state
   ------------------------------------------------------------------ */

@media (hover: hover) {
  a:hover {
    color: var(--shu);
  }

  .main-nav a:hover,
  .language-nav a:not([aria-current="page"]):hover {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }

  .btn-ink:hover {
    border-color: var(--shu);
    background: var(--shu);
    color: var(--white);
  }

  .btn-line:hover {
    border-color: var(--shu);
    background: var(--white);
    color: var(--shu);
  }

  .btn-shu:hover {
    border-color: var(--shu-deep);
    background: var(--shu-deep);
    color: var(--white);
  }
}


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

/* Small phones */
@media (max-width: 359px) {
  :root {
    --gutter: 14px;
  }
}

/* Phones: screenshots run to the screen edges for legibility. */
@media (max-width: 640px) {
  .shot {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
  }

  .shot img {
    border-right: 0;
    border-left: 0;
  }

  .shot figcaption {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
}

/* Tablets and up */
@media (min-width: 641px) {
  :root {
    --gutter: 32px;
  }

  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav language";
    min-height: 64px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .brand {
    font-size: 1.25rem;
  }

  .main-nav {
    justify-content: flex-end;
    margin-left: 0;
    margin-right: 20px;
  }

  .main-nav a {
    padding: 0 12px;
  }

  .masthead {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .masthead-text {
    margin-top: 20px;
    font-size: 1.0625rem;
  }

  .products > .wrap,
  .about > .wrap {
    padding-top: 28px;
  }

  .products .section-title {
    margin-bottom: 32px;
  }

  .products,
  .about {
    padding-bottom: 80px;
  }

  .shot {
    margin-top: 28px;
  }

  .shot figcaption {
    margin-top: 10px;
  }

  .lead {
    margin-top: 24px;
    font-size: 1.1875rem;
  }

  .tool .lead {
    font-size: 1.0625rem;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    margin-top: 40px;
  }

  .tool {
    margin-top: 72px;
    padding-top: 48px;
  }

  .contact {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .contact-main p {
    font-size: 1.0625rem;
  }

  .mail {
    font-size: 1.25rem;
  }

  .footer-inner {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .footer-inner p {
    order: 0;
    flex-basis: auto;
  }

  html:lang(ja) .masthead-text,
  html:lang(ja) .lead,
  html:lang(ja) .contact-main p {
    font-size: 1.0625rem;
  }

  html:lang(ja) .main-nav a {
    font-size: 0.9375rem;
  }
}

/* Ledger rows set term and description side by side wherever their column is wide enough. */
@media (min-width: 641px) and (max-width: 959px), (min-width: 1180px) {
  .ledger-split > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: 24px;
    align-items: baseline;
  }

  .ledger-split dd {
    margin-top: 0;
  }
}

/* The header stays in view only when there is height to spare. */
@media (min-width: 641px) and (min-height: 600px) {
  html {
    scroll-padding-top: 88px;
  }

  .site-header {
    position: sticky;
    top: 0;
  }
}

/* Desktop: a 5 / 7 editorial grid shared by every section */
@media (min-width: 960px) {
  .masthead {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .masthead-inner {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--gap);
    align-items: end;
    align-items: last baseline;
  }

  .masthead-text {
    margin-top: 0;
    padding-left: 24px;
    border-left: 1px solid var(--rule);
  }

  .product {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "head     shot"
      "lead     shot"
      "actions  shot"
      "features features"
      "tool     tool";
    column-gap: var(--gap);
    align-items: start;
  }

  .product > .product-head {
    grid-area: head;
  }

  .product > .shot {
    grid-area: shot;
    margin-top: 0;
  }

  .product > .lead {
    grid-area: lead;
  }

  .product > .actions {
    grid-area: actions;
  }

  .product > .features {
    grid-area: features;
    margin-top: 56px;
  }

  .product > .tool {
    grid-area: tool;
  }

  /* OtoMado mirrors the spread: screenshot left, copy right, tools beneath. */
  .tool {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "shot  head"
      "shot  lead"
      "shot  note"
      "shot  actions"
      "tools tools";
    column-gap: var(--gap);
    align-items: start;
    margin-top: 80px;
    padding-top: 56px;
  }

  .tool > .tool-head {
    grid-area: head;
  }

  .tool > .shot {
    grid-area: shot;
    margin-top: 0;
  }

  .tool > .lead {
    grid-area: lead;
  }

  .tool > .note {
    grid-area: note;
  }

  .tool > .actions {
    grid-area: actions;
  }

  .tool > .tools {
    grid-area: tools;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
    margin-top: 56px;
  }

  .about-inner,
  .contact-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--gap);
    align-items: baseline;
  }

  .about-work,
  .contact-guide {
    margin-top: 0;
  }

  .products,
  .about {
    padding-bottom: 96px;
  }

  .contact {
    padding-top: 64px;
    padding-bottom: 80px;
  }
}

/* Wide desktop */
@media (min-width: 1180px) {
  :root {
    --gutter: 40px;
    --gap: 64px;
  }

  .masthead-text {
    padding-left: 28px;
  }

  .platforms img {
    width: 44px;
    height: 44px;
  }

  .features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
