/* 千掛け — 月額1,000円、保険金1億円の災害死亡保険
   Design notes
   -------------------------------------------------------------------
   The page is built around one vertical line of mincho type, the way a
   kakejiku (掛け軸) hangs — 掛け is the kanji the brand shares with it,
   and 保険を掛ける is how you say "take out a policy" in Japanese. The
   single red mark is a hanko: the thing that makes a Japanese contract
   real. Everything else is passbook ruling — hairlines, no cards, no
   shadows — because the product is four facts, not a feature grid.
   Palette is 月白 (moon-white) over 藍 (indigo ink) with 朱 (seal
   vermilion) used exactly twice.
*/

:root {
	--paper:   #EAEFF3;
	--panel:   #FFFFFF;
	--ink:     #12304C;
	--ink-2:   #4E6477;
	--rule:    #C3D0DB;
	--rule-2:  #DEE6EC;
	--seal:    #BE3A26;
	--grid:    rgba(18, 48, 76, 0.055);

	--mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho",
	          "Noto Serif JP", serif;
	--gothic: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN",
	          "Yu Gothic", Meiryo, system-ui, sans-serif;

	--measure: 36em;
	--gap:     clamp(3.5rem, 9vw, 7rem);
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--gothic);
	font-size: clamp(1rem, 0.97rem + 0.2vw, 1.0625rem);
	line-height: 1.85;
	font-feature-settings: "palt" 1;
}

h1, h2, h3 { font-family: var(--mincho); font-weight: 600; line-height: 1.4; }

a { color: inherit; }

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

.wrap {
	width: 100%;
	max-width: 62rem;
	margin: 0 auto;
	padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

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

.masthead {
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
}

.masthead__inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 4.25rem;
}

.wordmark {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	font-family: var(--mincho);
	font-weight: 600;
	font-size: 1.375rem;
	letter-spacing: 0.08em;
	text-decoration: none;
	margin-right: auto;
}

.wordmark span {
	font-family: var(--gothic);
	font-size: 0.6875rem;
	letter-spacing: 0.22em;
	color: var(--ink-2);
}

.masthead__nav {
	display: flex;
	gap: 1.5rem;
	font-size: 0.875rem;
}

.masthead__nav a {
	text-decoration: none;
	padding: 0.25rem 0;
	border-bottom: 1px solid transparent;
}

.masthead__nav a:hover { border-bottom-color: var(--ink); }

.lang {
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	color: var(--ink-2);
	text-decoration: none;
	border: 1px solid var(--rule);
	border-radius: 2px;
	padding: 0.2rem 0.55rem;
}

.lang:hover { color: var(--ink); border-color: var(--ink); }

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

.hero {
	position: relative;
	padding: var(--gap) 0 calc(var(--gap) * 0.8);
	overflow: hidden;
}

/* faint genkou-youshi ruling, behind the hanging line only */
.hero::before {
	content: "";
	position: absolute;
	inset: 0 0 0 auto;
	width: min(34rem, 60%);
	background-image: repeating-linear-gradient(
		to left, var(--grid) 0 1px, transparent 1px 2.75rem
	);
	-webkit-mask-image: linear-gradient(to right, transparent, #000 38%);
	mask-image: linear-gradient(to right, transparent, #000 38%);
	pointer-events: none;
}

.hero__inner {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: clamp(2rem, 6vw, 5rem);
	align-items: start;
}

.hanging {
	writing-mode: vertical-rl;
	font-family: var(--mincho);
	font-size: clamp(2.75rem, 7.5vw, 5rem);
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.06em;
	margin: 0;
	height: max-content;
	grid-column: 2;
}

.hanging em {
	font-style: normal;
	position: relative;
}

/* the second red mark: an emphasis rule beside 一億円, the way Japanese
   vertical text marks emphasis */
.hanging em::after {
	content: "";
	position: absolute;
	top: 0.14em;
	left: -0.42em;
	width: 0.12em;
	height: 2.9em;
	background: var(--seal);
	border-radius: 0.1em;
	opacity: 0.9;
}

.hero__lede {
	grid-column: 1;
	max-width: 30em;
	padding-top: 0.6rem;
}

.seal {
	width: clamp(4.5rem, 9vw, 6rem);
	height: auto;
	display: block;
	margin-bottom: 2rem;
	transform: rotate(-3.5deg);
}

.hero__lede p {
	margin: 0 0 1.4rem;
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
}

.hero__note {
	font-size: 0.8125rem;
	color: var(--ink-2);
	line-height: 1.7;
}

.cta {
	display: inline-block;
	font-family: var(--gothic);
	font-size: 0.9375rem;
	text-decoration: none;
	color: var(--panel);
	background: var(--ink);
	padding: 0.85rem 1.75rem;
	border: 0;
	border-radius: 2px;
	cursor: pointer;
}

.cta:hover { background: #0C2238; }

/* --------------------------------------------------------------- sections */

.section { padding: var(--gap) 0; border-top: 1px solid var(--rule); }

.section__head {
	display: grid;
	grid-template-columns: minmax(0, 14.5rem) minmax(0, var(--measure));
	gap: clamp(1rem, 4vw, 3rem);
	margin-bottom: 2.75rem;
}

.section__head h2 {
	margin: 0;
	font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
}

.section__head p { margin: 0; color: var(--ink-2); }

/* passbook rows: label left, figure right, hairline between */
.ledger { margin: 0; }

.ledger div {
	display: grid;
	grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
	gap: clamp(1rem, 4vw, 3rem);
	align-items: baseline;
	padding: 1.3rem 0;
	border-top: 1px solid var(--rule-2);
}

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

.ledger dt {
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	color: var(--ink-2);
}

.ledger dd { margin: 0; }

.ledger .figure {
	display: block;
	font-family: var(--mincho);
	font-weight: 600;
	font-size: clamp(1.75rem, 1.4rem + 1.7vw, 2.75rem);
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.ledger .figure small {
	font-family: var(--gothic);
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
	color: var(--ink-2);
	margin-left: 0.6rem;
	vertical-align: baseline;
}

.ledger .gloss {
	display: block;
	font-size: 0.875rem;
	color: var(--ink-2);
	margin-top: 0.35rem;
}

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

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.4rem; }
.prose p:last-child { margin-bottom: 0; }

.reasons {
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
	max-width: var(--measure);
}

.reasons li { padding: 1.3rem 0; border-top: 1px solid var(--rule-2); }
.reasons li:last-child { border-bottom: 1px solid var(--rule-2); }
.reasons h3 { margin: 0 0 0.4rem; font-size: 1.0625rem; }
.reasons p { margin: 0; font-size: 0.9375rem; color: var(--ink-2); }

/* honest two-column fit / not-fit */
.fit {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: clamp(1.5rem, 5vw, 3.5rem);
	max-width: 52rem;
}

.fit h3 {
	margin: 0 0 1rem;
	padding-bottom: 0.6rem;
	font-size: 1.0625rem;
	border-bottom: 1px solid var(--ink);
}

.fit ul { margin: 0; padding-left: 1.2em; font-size: 0.9375rem; }
.fit li { margin-bottom: 0.6rem; }
.fit--no h3 { border-bottom-color: var(--rule); color: var(--ink-2); }
.fit--no ul { color: var(--ink-2); }

/* -------------------------------------------------------------------- faq */

.faq { max-width: var(--measure); margin: 0; }

.faq dt {
	font-family: var(--mincho);
	font-weight: 600;
	font-size: 1.0625rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--rule-2);
}

.faq dd {
	margin: 0.5rem 0 1.4rem;
	font-size: 0.9375rem;
	color: var(--ink-2);
}

/* ------------------------------------------------------------------ signup */

.signup { background: var(--panel); border-top: 1px solid var(--rule); }

.signup__inner { padding: var(--gap) 0; max-width: var(--measure); }

.signup h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem); }
.signup p { margin: 0 0 1.75rem; }
.signup p:last-child { margin-bottom: 0; }

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

.footer {
	border-top: 1px solid var(--rule);
	padding: 3rem 0;
	font-size: 0.8125rem;
	color: var(--ink-2);
	line-height: 1.8;
}

.footer p { margin: 0 0 1rem; max-width: 46em; }
.footer p:last-child { margin-bottom: 0; }
/* one gothic weight is self-hosted, so the brand name in the small print
   is distinguished by colour rather than by weight */
.footer strong { color: var(--ink); font-weight: inherit; }

/* ------------------------------------------------------- other languages */

/* Japanese hangs; everything else lies flat in the same place, as a short
   right-aligned stack that balances the lede across the column. These rules
   must stay AFTER .hanging — they have identical specificity, so source
   order is what makes them win. */
.hanging--flat {
	writing-mode: horizontal-tb;
	text-align: right;
	font-size: clamp(2.25rem, 4.6vw, 3.5rem);
	line-height: 1.14;
	letter-spacing: 0;
	max-width: 12ch;
}

.hanging--flat em::after {
	top: auto;
	left: 0;
	right: auto;
	bottom: -0.08em;
	width: 100%;
	height: 0.07em;
}

/* The picker is a <details>, so it opens and closes with no JavaScript.
   Every language is listed in its own script — never a flag: one of these
   pages is read by a Brazilian and a Portuguese traveller alike. */
.langs { position: relative; }

.langs summary {
	list-style: none;
	cursor: pointer;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	color: var(--ink-2);
	border: 1px solid var(--rule);
	border-radius: 2px;
	padding: 0.2rem 0.6rem;
}

.langs summary::-webkit-details-marker { display: none; }
.langs summary::marker { content: ""; }
.langs summary:hover { color: var(--ink); border-color: var(--ink); }
.langs[open] summary { color: var(--ink); border-color: var(--ink); }

.langs ul {
	position: absolute;
	right: 0;
	top: calc(100% + 0.45rem);
	z-index: 10;
	margin: 0;
	padding: 0.4rem 0;
	min-width: 10rem;
	list-style: none;
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: 2px;
}

.langs li a,
.langs li span {
	display: block;
	padding: 0.4rem 1rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	white-space: nowrap;
	text-decoration: none;
}

.langs li a:hover { background: var(--paper); }
.langs li span { color: var(--ink-2); }

/* ------------------------------------------------------------- the claim */

/* Read by someone who has just lost a person. Nothing here is clever: wide
   targets, big type, one column, generous spacing, and the telephone number
   above the form rather than below it. No seal, no hanging headline, no
   brand voice — the masthead is the only thing the page borrows. */

.plain { background: var(--panel); }

.claim {
	max-width: 40rem;
	padding-top: clamp(2.5rem, 7vw, 4.5rem);
	padding-bottom: clamp(3rem, 8vw, 5rem);
}

.claim h1 {
	margin: 0 0 1.75rem;
	font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
}

.claim__intro p { margin: 0 0 1.25rem; font-size: 1.0625rem; }
.claim__intro p:first-child { font-size: 1.1875rem; }

/* the telephone block, deliberately the loudest thing on the page */
.callout {
	margin: 2.5rem 0;
	padding: 1.75rem;
	background: var(--paper);
	border-left: 3px solid var(--seal);
	border-radius: 2px;
}

.callout p { margin: 0; }
.callout__label { font-size: 0.875rem; color: var(--ink-2); }

.callout__number {
	font-family: var(--mincho);
	font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
	font-weight: 600;
	line-height: 1.25;
	margin: 0.3rem 0 0.2rem !important;
}

.callout__number a { text-decoration: none; }
.callout__number a:hover { text-decoration: underline; }
.callout__hours { font-size: 0.875rem; color: var(--ink-2); margin-bottom: 0.9rem !important; }
.callout p:last-child { font-size: 0.9375rem; }

.claim__formhead { margin: 3rem 0 0.75rem; font-size: 1.5rem; }
.claim__required { margin: 0 0 2rem; font-size: 0.9375rem; color: var(--ink-2); }

.claim__form fieldset {
	margin: 0 0 2.5rem;
	padding: 0;
	border: 0;
	border-top: 1px solid var(--rule);
}

.claim__form legend {
	padding: 0 0.75rem 0 0;
	font-family: var(--mincho);
	font-weight: 600;
	font-size: 1.125rem;
}

.fieldset__note {
	margin: 0 0 1.5rem;
	font-size: 0.875rem;
	color: var(--ink-2);
}

.field { margin-bottom: 1.5rem; }

.field label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.9375rem;
}

.req { color: var(--seal); font-size: 0.8125rem; }

.hint {
	margin: 0 0 0.45rem;
	font-size: 0.8125rem;
	color: var(--ink-2);
	line-height: 1.6;
}

.field input,
.field textarea {
	width: 100%;
	font-family: inherit;
	font-size: 1.0625rem;
	line-height: 1.5;
	color: var(--ink);
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: 2px;
	/* 2.9rem of height at this font size: comfortably past the 44px that a
	   thumb needs on the airport tablet */
	padding: 0.7rem 0.85rem;
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus {
	border-color: var(--ink);
	outline: 2px solid var(--seal);
	outline-offset: 1px;
}

.field--check {
	display: grid;
	grid-template-columns: 1.4rem 1fr;
	gap: 0.75rem;
	align-items: start;
	margin-bottom: 1.25rem;
}

.field--check input {
	width: 1.4rem;
	height: 1.4rem;
	margin: 0.15rem 0 0;
	accent-color: var(--ink);
}

.field--check label { margin: 0; font-size: 0.9375rem; line-height: 1.6; }

.claim__submit { margin: 2.5rem 0 0; }
.claim__submit .cta { font-size: 1.0625rem; padding: 0.95rem 2.5rem; }

.claim__after {
	margin-top: 3.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--rule);
}

.claim__after h2 { margin: 0 0 1.25rem; font-size: 1.5rem; }
.claim__after ol { margin: 0; padding-left: 1.4em; }
.claim__after li { margin-bottom: 0.9rem; }

.claim__back { margin-top: 3rem; font-size: 0.9375rem; }

/* the claims link on the home page: findable without being loud */
.footer__claim {
	margin-bottom: 1.5rem !important;
	font-size: 0.9375rem;
}

.footer__claim a { color: var(--ink); }

/* ------------------------------------------------------------ the stamping */

@media (prefers-reduced-motion: no-preference) {
	.seal {
		animation: stamp 620ms cubic-bezier(0.2, 0.9, 0.3, 1) 260ms both;
		transform-origin: 60% 40%;
	}
	@keyframes stamp {
		from { opacity: 0; transform: scale(1.5) rotate(-7deg); }
		60%  { opacity: 1; transform: scale(0.97) rotate(-2.5deg); }
		to   { opacity: 1; transform: scale(1) rotate(-3.5deg); }
	}
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 46rem) {
	/* Section links are a scroll away on a page this short, so the header
	   keeps only what it needs: the name and the other language. */
	.masthead__nav { display: none; }
	.wordmark { white-space: nowrap; }

	/* the hanging line lies down rather than squeezing the column, and
	   leads the page the way it does on a wide screen */
	.hero__inner { grid-template-columns: 1fr; }

	.hanging {
		writing-mode: horizontal-tb;
		grid-column: 1;
		grid-row: 1;
		font-size: clamp(2.75rem, 13vw, 4rem);
		line-height: 1.25;
		letter-spacing: 0.02em;
		margin: 0 0 2.75rem;
	}

	/* the emphasis mark turns into an underline when the text lies down */
	.hanging em::after {
		top: auto;
		left: 0;
		bottom: -0.1em;
		width: 100%;
		height: 0.08em;
	}

	.hero__lede { grid-row: 2; padding-top: 0; }
	.hero::before { width: 100%; opacity: 0.6; }

	.seal { margin-bottom: 1.5rem; }

	.section__head,
	.ledger div { grid-template-columns: 1fr; gap: 0.4rem; }

	.ledger dt { letter-spacing: 0.14em; }
}
