/* ── Font faces ──────────────────────────────────────────────────────── */
@font-face {
	font-family: "IBM Plex Sans";
	src: url("fonts/IBMPlexSans-VF.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Serif";
	src: url("fonts/IBMPlexSerif-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Serif";
	src: url("fonts/IBMPlexSerif-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("fonts/IBMPlexMono-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ── Variables ───────────────────────────────────────────────────────── */
:root {
	--maxw: 1200px;
	--fg: #000;
	--bg: #fff;
	--rule: #e5e5e5;
	--muted: #666;
	--bg-raised: #f7f7f7;
	--bg-input: #fff;
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }

body {
	font-family: "IBM Plex Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
	font-size: 10pt;
	line-height: 1.5;
}

/* ── Header ──────────────────────────────────────────────────────────── */
header, main { max-width: var(--maxw); margin: 24px auto; padding: 0 16px; }
header {
	display: flex;
	gap: 16px;
	align-items: center;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--rule);
	padding-bottom: 12px;
}
h1 { margin: 0; font-size: 10pt; font-weight: 500; letter-spacing: 0.05em; line-height: 1; }
h1 a { color: inherit; text-decoration: none; display: block; }
h1 a:hover { text-decoration: none; }
h1 .logo { height: 16px; width: auto; display: block; }
h3 { font-size: inherit; margin: 0; }

nav {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-left: 24px;
}
.nav-right {
	margin-left: auto;
}
.nav-link {
	color: var(--muted);
	text-decoration: none;
	font-weight: 200;
	padding: 4px 0;
	border-bottom: 1px solid transparent;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active {
	color: var(--fg);
	border-bottom-color: var(--fg);
}
.lang-switcher {
	display: flex;
	gap: 2px;
	align-items: center;
	margin-left: 12px;
}
.lang-switcher a {
	color: var(--muted);
	text-decoration: none;
	font-size: 7pt;
	font-weight: 400;
	letter-spacing: 0.03em;
	padding: 2px 5px;
}
.lang-switcher a:hover { color: var(--fg); text-decoration: none; }
.lang-switcher a.active { color: var(--fg); font-weight: 700; }

/* ── Product cards ───────────────────────────────────────────────────── */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.product-cards {
	border-top: 1px solid var(--rule);
	padding-top: 12px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.product-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--rule);
	text-decoration: none;
	overflow: hidden;
	transition: border-color 0.2s;
	max-width: 500px;
}
.product-card:hover {
	border-color: var(--fg);
	text-decoration: none;
}

.card-text {
	padding: 10px 16px;
}
.card-title-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
}
.card-name {
	margin: 0;
	font-size: 10pt;
	font-weight: 300;
	letter-spacing: 0.02em;
}
.card-price {
	font-weight: 300;
	font-size: 8pt;
	color: var(--muted);
	margin-left: auto;
	white-space: nowrap;
}

.card-visual {
	position: relative;
	min-height: 180px;
	background: var(--bg);
	overflow: hidden;
	border-top: 1px solid var(--rule);
}
.card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1);
	opacity: 0.15;
	display: block;
}
.card-ascii {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 8px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 7pt;
	line-height: 1.3;
	color: var(--fg);
	background: none;
	border: none;
	pointer-events: none;
	white-space: pre;
	display: flex;
	align-items: center;
}

/* ── Product hero ASCII ──────────────────────────────────────────────── */
.product-hero-ascii {
	width: 100%;
	min-height: 200px;
	margin-bottom: 24px;
	border: 1px solid var(--rule);
	border-top: none;
	overflow: hidden;
	position: relative;
}
.product-hero-ascii pre {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 12px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 7pt;
	line-height: 1.2;
	color: var(--muted);
	background: none;
	border: none;
	white-space: pre;
}

/* ── Product detail view ─────────────────────────────────────────────── */
.product {
	display: grid;
	gap: 32px;
	grid-template-columns: 1fr;
	border-top: 1px solid var(--rule);
	padding-top: 12px;
}
.product .info h2 {
	margin: 0;
	margin-top: 16px;
	font-size: 11pt;
	font-weight: 300;
	letter-spacing: 0.01em;
}
.product .info .tagline {
	color: var(--muted);
	font-size: 8pt;
	margin-top: 4px;
}
.product .info .meta {
	color: var(--muted);
	margin-top: 8px;
	font-size: 7pt;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.product .info .price-block {
	margin-top: 12px;
	font-size: 10pt;
	font-weight: 300;
}
.product .info .buy-links {
	margin-top: 12px;
	display: flex;
	gap: 8px;
	flex-wrap: nowrap;
}
.product .info .buy-link {
	display: inline-block;
	padding: 5px 10px;
	background: var(--fg);
	color: var(--bg);
	text-decoration: none;
	font-size: 7pt;
	font-weight: 500;
	letter-spacing: 0.02em;
	border: 1px solid var(--fg);
	transition: background 0.15s, color 0.15s;
}
.product .info .buy-link:hover {
	background: var(--bg);
	color: var(--fg);
	text-decoration: none;
}
.product .info .buy-link.secondary {
	background: var(--bg);
	color: var(--fg);
}
.product .info .buy-link.secondary:hover {
	background: var(--fg);
	color: var(--bg);
}

/* Coming soon state */
.product .info .coming-soon-notice {
	margin-top: 20px;
	padding: 12px 16px;
	background: var(--bg-raised);
	border: 1px solid var(--rule);
	font-size: 8pt;
	color: var(--muted);
}

/* Features list */
.product .info .features {
	margin-top: 20px;
	padding: 0;
	list-style: none;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 9pt;
}
.product .info .features li {
	padding: 4px 0;
	font-size: 8pt;
	border-bottom: 1px solid var(--rule);
}
.product .info .features li:last-child {
	border-bottom: none;
}

/* Detail column (description + media) */
.product .detail {
	/* Align with h2 in info column: back-link height (~19px) + h2 margin-top (16px) */
	padding-top: 35px;
}
.product .detail .description {
	white-space: normal;
	font-family: "IBM Plex Serif", "Hiragino Mincho ProN", "Noto Serif JP", serif;
	font-size: 11pt;
	line-height: 1.7;
	max-width: 65ch;
	column-count: 1;
}
.product .detail .description p {
	margin: 0 0 1em;
}
.product .detail .description p:last-child {
	margin-bottom: 0;
}
.product .detail .description .desc-rule {
	border: none;
	border-top: 1px solid var(--rule);
	margin: 1em 0;
}
.product .detail .description .desc-heading {
	display: block;
	font-family: "IBM Plex Sans", sans-serif;
	font-weight: 700;
	font-size: 11pt;
	margin-top: 1em;
	margin-bottom: 1em;
}

/* Audio player */
.audiolist { display: grid; gap: 6px; margin-top: 12px; }
.audioitem {
	border: 1px solid var(--rule);
	padding: 6px 8px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	background: var(--bg);
	font-size: 8pt;
}
.audioitem:hover { background: var(--bg-raised); }
.audioitem.playing { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.audioitem .state { font-weight: 700; min-width: 34px; }
.audioitem .name { overflow-wrap: anywhere; }
.audioitem .dur { color: inherit; opacity: 0.7; }
.audiolist audio[data-minimal="1"] { display: none; }

/* Product videos */
.product .product-videos {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.product .product-video {
	width: 100%;
	height: auto;
	display: block;
	background: #000;
}
.product .video-name {
	font-size: 8pt;
	padding: 4px 0 0;
	overflow-wrap: anywhere;
}

/* Media gallery */
.product .media {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.product .media img {
	width: 100%;
	height: auto;
	display: block;
	background: var(--bg-raised);
	cursor: pointer;
}
.product .media .featured-image {
	grid-column: 1 / -1;
}

/* ── About page ──────────────────────────────────────────────────────── */
.about {
	border-top: 1px solid var(--rule);
	padding-top: 12px;
	max-width: 640px;
}
.about h2 {
	margin: 0;
	margin-top: 16px;
	font-size: 10pt;
	font-weight: 700;
}
.about p {
	font-family: "IBM Plex Serif", "Hiragino Mincho ProN", "Noto Serif JP", serif;
	font-size: 11pt;
	line-height: 1.7;
	margin: 12px 0;
}
.about h3 {
	margin: 1.5em 0 1em;
	font-size: 10pt;
	font-weight: 700;
}
.about .contact {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--rule);
}
.about .contact a {
	text-decoration: underline;
}
.about-footer {
	margin-top: 48px;
	padding-top: 16px;
	border-top: 1px solid var(--rule);
	font-size: 7pt;
	color: var(--muted);
	line-height: 1.6;
}
.about-footer .corporate-name {
	font-weight: 700;
	letter-spacing: 0.05em;
	margin-bottom: 4px;
}

/* ── Back link ───────────────────────────────────────────────────────── */
.back-link {
	display: inline-block;
	color: var(--muted);
	font-size: 8pt;
	margin-bottom: 8px;
}
.back-link:hover {
	color: var(--fg);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.product-list.cols { grid-template-columns: 1fr; row-gap: 0; }
	.product .media { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
	header { margin-top: 32px; }
	.product-cards { grid-template-columns: 1fr 1fr; }
	.product { grid-template-columns: 280px 1fr; align-items: start; }
}

/* ── Lightbox ────────────────────────────────────────────────────────── */
.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 95vw; max-height: 95vh; }

/* ── Auth forms ──────────────────────────────────────────────────────── */
.auth-form {
	max-width: 320px;
	border-top: 1px solid var(--rule);
	padding-top: 12px;
}
.auth-form h2 {
	margin: 0;
	margin-top: 16px;
	font-size: 10pt;
	font-weight: 700;
}
.auth-form form {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
	font: inherit;
	color: inherit;
	border: 1px solid var(--rule);
	padding: 8px;
	background: var(--bg-input);
}
.auth-form input:focus {
	outline: none;
	border-color: var(--fg);
}
.auth-form button {
	font: inherit;
	padding: 8px 16px;
	background: var(--fg);
	color: var(--bg);
	border: 1px solid var(--fg);
	cursor: pointer;
	font-weight: 500;
	letter-spacing: 0.02em;
}
.auth-form button:hover { background: var(--bg); color: var(--fg); }
.auth-form button:disabled { opacity: 0.5; cursor: default; }
.auth-error { color: #c00; font-size: 8pt; min-height: 1.2em; }
.auth-notice { font-size: 8pt; color: var(--muted); margin: 12px 0 0; padding: 10px 12px; background: var(--bg-raised); border: 1px solid var(--rule); }
.auth-alt { font-size: 8pt; color: var(--muted); margin-top: 12px; }
.auth-alt a { text-decoration: underline; }
.auth-form p { font-size: 8pt; line-height: 1.5; margin: 12px 0; }

/* ── Account page ────────────────────────────────────────────────────── */
.account-page {
	border-top: 1px solid var(--rule);
	padding-top: 12px;
	max-width: 480px;
}
.account-page h2 {
	margin: 0;
	margin-top: 16px;
	font-size: 10pt;
	font-weight: 700;
}
.account-page h3 {
	margin-top: 24px;
	font-size: 9pt;
}
.account-info { margin-top: 8px; font-size: 8pt; color: var(--muted); }
.account-info p { margin: 0; }
.licenses-list { margin-top: 8px; }
.license-card {
	border: 1px solid var(--rule);
	padding: 12px;
	margin-bottom: 8px;
}
.license-product { font-weight: 700; font-size: 8pt; margin-bottom: 6px; }
.license-bubbles {
	font-family: "IBM Plex Mono", monospace;
	font-size: 8pt;
	line-height: 1.4;
	color: var(--fg);
	margin: 0;
	padding: 12px 8px;
	background: var(--bg-raised);
	border: 1px solid var(--rule);
	overflow-x: auto;
}
.license-key-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.license-key {
	font-family: "IBM Plex Mono", monospace;
	font-size: 9pt;
	letter-spacing: 0.05em;
	background: var(--bg-raised);
	padding: 4px 8px;
	border: 1px solid var(--rule);
}
.copy-btn {
	font: inherit;
	font-size: 7pt;
	padding: 3px 8px;
	background: var(--bg);
	border: 1px solid var(--rule);
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fg);
}
.copy-btn:hover { border-color: var(--fg); }
.license-meta { font-size: 7pt; color: var(--muted); margin-top: 6px; }
.muted { color: var(--muted); }
.logout-btn {
	font: inherit;
	font-size: 8pt;
	margin-top: 24px;
	padding: 6px 12px;
	background: var(--bg);
	color: var(--muted);
	border: 1px solid var(--rule);
	cursor: pointer;
}
.logout-btn:hover { color: var(--fg); border-color: var(--fg); }

/* ── Trial ──────────────────────────────────────────────────────────── */
.trial-btn {
	font: inherit;
	font-size: 8pt;
	padding: 6px 12px;
	background: var(--fg);
	color: var(--bg);
	border: 1px solid var(--fg);
	cursor: pointer;
	font-weight: 500;
	letter-spacing: 0.02em;
}
.trial-btn:hover { background: var(--bg); color: var(--fg); }
.trial-badge {
	font-size: 7pt;
	padding: 2px 6px;
	letter-spacing: 0.03em;
	font-weight: 500;
}
.trial-badge.active {
	background: var(--bg-raised);
	border: 1px solid var(--rule);
	color: var(--fg);
}
.trial-badge.expired {
	background: var(--bg-raised);
	border: 1px solid var(--rule);
	color: var(--muted);
}

/* ── Feedback page ───────────────────────────────────────────────────── */
.feedback-page {
	border-top: 1px solid var(--rule);
	padding-top: 12px;
	max-width: 400px;
}
.feedback-page h2 {
	margin: 0;
	margin-top: 16px;
	font-size: 10pt;
	font-weight: 700;
}
.feedback-page p {
	font-size: 8pt;
	color: var(--muted);
	margin: 8px 0 0;
}
.feedback-page form {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.feedback-page select,
.feedback-page input[type="email"],
.feedback-page textarea {
	font: inherit;
	color: inherit;
	border: 1px solid var(--rule);
	padding: 8px;
	background: var(--bg-input);
	resize: vertical;
}
.feedback-page select:focus,
.feedback-page input:focus,
.feedback-page textarea:focus {
	outline: none;
	border-color: var(--fg);
}
.feedback-page button {
	font: inherit;
	padding: 8px 16px;
	background: var(--fg);
	color: var(--bg);
	border: 1px solid var(--fg);
	cursor: pointer;
	font-weight: 500;
	letter-spacing: 0.02em;
}
.feedback-page button:hover { background: var(--bg); color: var(--fg); }
.feedback-page button:disabled { opacity: 0.5; cursor: default; }
.feedback-status { font-size: 8pt; min-height: 1.2em; margin-top: 4px; }
.feedback-status.success { color: #4a4; }
.feedback-status.error { color: #c00; }

/* PPP regional pricing */
.ppp-label {
	font-size: 7pt;
	font-weight: 400;
	color: var(--muted);
	display: block;
	margin-top: 2px;
}

/* Buy checkout button (styled like buy-link) */
button.buy-link {
	font: inherit;
	cursor: pointer;
}

/* ── Product ASCII signature (legacy, now used as hero) ──────────────── */
.ascii-signature {
	font-family: "IBM Plex Mono", monospace;
	font-size: 7pt;
	line-height: 1.2;
	color: var(--muted);
	margin: 0;
	padding: 0;
	background: none;
	border: none;
	min-height: 10em;
}

/* ── NOMN Temporal Signatures ────────────────────────────────────────── */
.ts-wrap {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	background: var(--bg);
}
.ts-cell {
	border-right: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	position: relative;
	overflow: hidden;
}
.ts-cell:nth-child(3n) { border-right: none; }
.ts-cell:nth-child(n+4) { border-bottom: none; }
.ts-lbl {
	font-family: "IBM Plex Mono", monospace;
	font-size: 6px;
	font-weight: 500;
	letter-spacing: 0.3px;
	padding: 4px 6px 0;
	line-height: 1.3;
	color: var(--fg);
}
.ts-sub {
	font-family: "IBM Plex Mono", monospace;
	font-size: 5px;
	color: #bbb;
	padding: 1px 6px 0;
	line-height: 1.3;
}
.ts-bars {
	position: relative;
	height: calc(100% - 30px);
	min-height: 40px;
	overflow: hidden;
}
.ts-bar {
	position: absolute;
	bottom: 0;
	width: 1px;
	background: var(--fg);
	will-change: transform;
}
.ts-bar-tick {
	position: absolute;
	top: -1px;
	left: -1px;
	width: 3px;
	height: 1px;
	background: #ccc;
}
.ts-foot {
	font-family: "IBM Plex Mono", monospace;
	font-size: 5px;
	color: #aaa;
	padding: 2px 6px 4px;
	line-height: 1.3;
}
/* Magnifier */
.ts-mag {
	position: absolute;
	bottom: 2px;
	right: 2px;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
	z-index: 2;
}
.ts-mag-lbl {
	font-family: "IBM Plex Mono", monospace;
	font-size: 4px;
	color: #999;
	letter-spacing: 0.5px;
	margin-bottom: 1px;
}
.ts-mag-box {
	border: 1px solid #aaa;
	border-radius: 50%;
	width: 32px;
	height: 26px;
	background: #fff;
	overflow: hidden;
	position: relative;
}
.ts-mag-bar {
	position: absolute;
	bottom: 3px;
	width: 1px;
	background: var(--fg);
	will-change: transform;
}
.ts-mag-hdl {
	width: 1px;
	height: 6px;
	background: #aaa;
	transform: rotate(35deg);
	transform-origin: top center;
	margin-top: -1px;
	margin-left: 10px;
}
.ts-mag-left {
	right: auto;
	left: 4px;
}
.ts-mag-hdl-left {
	transform: rotate(-35deg);
	margin-left: 20px;
}

/* Hero version: larger cells */
.product-hero-ascii .ts-wrap {
	position: relative;
	min-height: 200px;
}
.product-hero-ascii .ts-lbl { font-size: 8px; padding: 8px 8px 0; }
.product-hero-ascii .ts-sub { font-size: 7px; padding: 1px 8px 0; }
.product-hero-ascii .ts-bars { height: 80px; }
.product-hero-ascii .ts-foot { font-size: 6px; padding: 4px 8px 6px; }
.product-hero-ascii .ts-mag-box { width: 44px; height: 36px; }

@media (max-width: 480px) {
	.ts-wrap { grid-template-columns: 1fr 1fr; }
	.ts-cell:nth-child(3n) { border-right: 1px solid var(--rule); }
	.ts-cell:nth-child(2n) { border-right: none; }
	.ts-cell:nth-child(n+5) { border-bottom: none; }
	.ts-cell:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }
}

/* ── Motion preferences ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.card-ascii,
	.ascii-signature,
	.product-hero-ascii pre {
		transition: none;
	}
	.card-ascii {
		transform: none !important;
	}
}
