/* Penguin by the Sea — 2008–2018
 * Apple & index.html visual DNA:
 * Pure white / neutral-950 surfaces, neutral-50/70 alternating bands,
 * rounded-2xl / rounded-3xl media, hairline neutral borders, and deep sea navy (#193951) accents.
 */

:root {
	--navy: #193951;
	--navy-deep: #0d2030;
}

html {
	scroll-behavior: smooth;
	overflow-x: clip;
	scrollbar-gutter: stable;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body {
	margin: 0;
	font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
	overflow-x: hidden;
}

[v-cloak] {
	display: none;
}

/* ===== Hero (Preserved) ===== */
.pbts-hero {
	position: relative;
	min-height: 100svh;
	min-height: max(660px, 100svh);
	overflow: hidden;
	background: #dce5ed;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.pbts-hero__media {
	position: absolute;
	inset: -4% 0;
	will-change: transform;
}

.sea-hero__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 57% center;
	object-position: clamp(100%, calc(60.7% + 9vw), 0px) center;
	display: block;
}

.pbts-hero__veil {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(220, 229, 237, 0.38) 0%, rgba(220, 229, 237, 0.06) 36%, transparent 62%, rgba(15, 23, 42, 0.16) 100%);
}

.pbts-hero__content {
	position: relative;
	z-index: 2;
	padding-top: clamp(144px, 19.5vh, 232px);
	padding-inline: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.pbts-hero__years {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: "Inter", sans-serif;
	font-size: clamp(1rem, 1.5vw, 1.25rem);
	font-weight: 500;
	letter-spacing: 0.08em;
	color: rgba(25, 57, 81, 0.86);
	margin-bottom: clamp(16px, 2.4vh, 26px);
	font-variant-numeric: tabular-nums;
}

.pbts-odo-group {
	display: inline-flex;
	align-items: center;
}

.pbts-odo-slot {
	display: inline-block;
	height: 28px;
	line-height: 28px;
	overflow: hidden;
	vertical-align: middle;
}

.pbts-odo-reel {
	display: flex;
	flex-direction: column;
	will-change: transform;
}

.pbts-odo-reel > span {
	display: block;
	height: 28px;
	line-height: 28px;
	text-align: center;
}

.pbts-odo-dash {
	display: inline-flex;
	align-items: center;
	height: 28px;
	line-height: 28px;
}

.sea-hero__title {
	position: relative;
	width: min(86vw, 580px);
	aspect-ratio: 605.912 / 121.161;
	margin: 0;
}

.sea-hero__title img,
.sea-hero__title svg {
	display: block;
	width: 100%;
	height: 100%;
}

.sea-hero__writing {
	position: absolute;
	inset: 0;
}

.sea-hero__title[data-writing] > img {
	visibility: hidden;
}

/* ===== Section 01: Horizontal Film Rail (from index_v2) ===== */
.pbts-rail {
	display: flex;
	gap: clamp(14px, 2vw, 22px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-bottom: 4px;
	padding-inline: 1rem;
	scroll-padding-inline: 1rem;
	cursor: grab;
}

@media (min-width: 640px) {
	.pbts-rail {
		padding-inline: 1.5rem;
		scroll-padding-inline: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.pbts-rail {
		padding-inline: max(2rem, calc((100vw - 80rem) / 2 + 2rem));
		scroll-padding-inline: max(2rem, calc((100vw - 80rem) / 2 + 2rem));
	}
}

.pbts-rail::-webkit-scrollbar {
	display: none;
}

.pbts-rail.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.pbts-rail__item {
	flex: 0 0 auto;
	width: clamp(268px, 38vw, 440px);
	scroll-snap-align: start;
}

.pbts-rail__item--wide {
	width: clamp(300px, 52vw, 600px);
}

.pbts-rail__photo {
	position: relative;
	border-radius: 1.25rem;
	overflow: hidden;
	aspect-ratio: 3 / 2;
}

.pbts-rail__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.pbts-rail__item:hover .pbts-rail__photo img {
	transform: scale(1.03);
}

/* ===== Section 02: Four-pane Window + Winter Frost (from index_v2) ===== */
.pbts-window {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border-radius: 1.5rem;
	overflow: hidden;
	border: 1px solid rgba(229, 229, 229, 0.9);
	background: rgba(229, 229, 229, 0.9);
	aspect-ratio: 4 / 3;
}

html.dark .pbts-window {
	border-color: rgba(38, 38, 38, 0.9);
	background: rgba(38, 38, 38, 0.9);
}

.pbts-window__row {
	display: flex;
	gap: 2px;
	flex: 1;
	min-height: 0;
	transition: flex 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.pbts-window__row.is-active {
	flex: 1.9;
}

.pbts-pane {
	position: relative;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	cursor: pointer;
	transition: flex 0.8s cubic-bezier(0.22, 1, 0.36, 1);
	background: #141923;
}

.pbts-pane.is-active {
	flex: 2.5;
}

.pbts-pane img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1.06);
	transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}

.pbts-pane:not(.is-active) img {
	filter: saturate(0.84) brightness(0.88);
}

.pbts-pane.is-active img {
	transform: scale(1);
}

.pbts-pane__label {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 3;
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.54);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.94);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.pbts-pane__label strong {
	font-weight: 500;
}

.pbts-pane__label span {
	opacity: 0.7;
}

.pbts-pane__caption {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	max-width: 46%;
	text-align: right;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.48);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.45s ease 0.12s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
	pointer-events: none;
}

.pbts-pane.is-active .pbts-pane__caption {
	opacity: 1;
	transform: translateY(0);
}

@media (max-width: 720px) {
	.pbts-window {
		aspect-ratio: 4 / 5;
	}
	.pbts-pane__label {
		left: 8px;
		bottom: 8px;
		gap: 5px;
		padding: 4px 8px;
		font-size: 0.6875rem;
		max-width: calc(100% - 16px);
	}
	.pbts-pane__label span {
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.pbts-pane__caption {
		display: none;
	}
}

/* ===== Section 03: 3D flip marquee (from index_v2) ===== */
.pbts-pop {
	display: grid;
	gap: clamp(10px, 1.2vw, 16px);
	/* overflow-x: clip prevents horizontal wheel scroll without flattening 3D card flips. */
	overflow-x: clip;
	padding-block: clamp(14px, 1.8vw, 26px);
	contain: layout style;
}

.pbts-pop__row {
	position: relative;
	contain: layout style;
}

.pbts-pop__track {
	--pbts-pop-gap: clamp(10px, 1.2vw, 16px);
	display: flex;
	gap: var(--pbts-pop-gap);
	width: max-content;
	will-change: transform;
	animation: pbts-pop-scroll calc(78s * var(--pbts-pop-card-count, 16) / 16) linear infinite;
}

.pbts-pop.is-paused .pbts-pop__track {
	animation-play-state: paused;
}

.pbts-pop__row.is-reverse .pbts-pop__track {
	animation-direction: reverse;
}

.pbts-pop__row:hover .pbts-pop__track {
	animation-play-state: paused;
}

@keyframes pbts-pop-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(calc(-50% - var(--pbts-pop-gap) / 2)); }
}

.pbts-pop__card {
	flex: 0 0 auto;
	width: clamp(112px, 11.5vw, 168px);
	aspect-ratio: 1 / 1;
	perspective: 900px;
}

.pbts-pop__inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.pbts-pop__card:hover .pbts-pop__inner {
	transform: rotateY(180deg);
}

.pbts-pop__face {
	position: absolute;
	inset: 0;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid rgba(229, 229, 229, 0.9);
	background: #f5f5f7;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

html.dark .pbts-pop__face {
	border-color: rgba(38, 38, 38, 0.9);
	background: #171717;
}

.pbts-pop__face--front img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pbts-pop__face--front::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 26%, rgba(0, 0, 0, 0.12) 100%);
}

.pbts-pop__fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	text-align: center;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #737373;
}

.pbts-pop__face--back {
	transform: rotateY(180deg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	text-align: center;
	background: #f5f5f7;
}

html.dark .pbts-pop__face--back {
	background: #171717;
}

.pbts-pop__title {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.01em;
	color: #171717;
}

html.dark .pbts-pop__title {
	color: #f5f5f5;
}

/* ===== Lightbox ===== */
.pbts-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(10, 14, 20, 0.88);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(20px, 4vw, 48px);
}

.pbts-lightbox__img {
	max-width: min(92vw, 1280px);
	max-height: 78vh;
	border-radius: 1rem;
	object-fit: contain;
	box-shadow: 0 24px 72px rgba(0, 0, 0, 0.45);
}

.pbts-fade-enter-active,
.pbts-fade-leave-active {
	transition: opacity 0.25s ease;
}

.pbts-fade-enter-from,
.pbts-fade-leave-to {
	opacity: 0;
}

/* ===== Apple-style Page Loader & Hero Entrance ===== */
html.pbts-loading,
html.pbts-loading body {
	overflow: hidden;
	height: 100%;
}

html:not(.pbts-entered) .pbts-hero__years,
html:not(.pbts-entered) .sea-hero__title,
html:not(.pbts-entered) header {
	opacity: 0;
}

.pbts-loader {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	color: #171717;
	transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), visibility 0.5s ease;
}

html.dark .pbts-loader {
	background: #0a0a0a;
	color: #f5f5f5;
}

.pbts-loader.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.pbts-loader__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transition: opacity 0.35s ease;
}

.pbts-loader.is-done .pbts-loader__inner {
	opacity: 0;
}

.pbts-loader__years {
	margin: 0;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-indent: 0.24em;
	font-variant-numeric: tabular-nums;
	color: #193951;
}

html.dark .pbts-loader__years {
	color: #e2e8f0;
}

.pbts-loader__track {
	width: 140px;
	height: 2px;
	border-radius: 9999px;
	background: rgba(23, 23, 23, 0.1);
	overflow: hidden;
}

html.dark .pbts-loader__track {
	background: rgba(255, 255, 255, 0.14);
}

.pbts-loader__bar {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background: #193951;
	transform-origin: left center;
	transform: scaleX(0.15);
	transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html.dark .pbts-loader__bar {
	background: #bae6fd;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.pbts-loader,
	.pbts-loader__inner,
	.pbts-loader__bar {
		transition: none;
	}
}
