/* ============================================================
   Apple homepage — local research replica
   ============================================================ */

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

:root {
	--color-black: #000;
	--color-dark: #1d1d1f;
	--color-text: #1d1d1f;
	--color-text-light: #f5f5f7;
	--color-link: #0066cc;
	--color-link-hover: #0077ed;
	--color-gray: #86868b;
	--color-bg: #fff;
	--color-bg-alt: #f5f5f7;
	--nav-height: 44px;
	--max-width: 1440px;
}

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

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Segoe UI", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.47059;
	font-weight: 400;
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, picture, svg { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

/* ================= GLOBAL NAV ================= */
.globalnav {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 9999;
	height: var(--nav-height);
	background: rgba(0, 0, 0, .8);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	color: var(--color-text-light);
}
.globalnav-content {
	position: relative;
	max-width: 1024px;
	height: 100%;
	margin: 0 auto;
	padding: 0 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.globalnav-list {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	flex: 1;
	margin: 0 auto;
	padding: 0 30px;
}
.globalnav-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(245, 245, 247, .8);
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	padding: 0 8px;
	height: var(--nav-height);
	transition: color .32s;
}
.globalnav-list .globalnav-link { padding: 0; }
.globalnav-link:hover { color: #fff; text-decoration: none; }
.globalnav-apple svg { width: 14px; height: 44px; fill: currentColor; }
.globalnav-apple { padding: 0; }
.globalnav-right { display: flex; align-items: center; gap: 4px; }
.globalnav-icon { width: auto; min-width: 32px; padding: 0 6px; }
.globalnav-icon svg { width: 15px; height: 44px; fill: currentColor; }

/* animated APP download entry */
.app-download {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	padding: 6px 13px;
	border-radius: 980px;
	white-space: nowrap;
	background: linear-gradient(110deg, #0a84ff 0%, #5e5ce6 35%, #bf5af2 65%, #ff375f 100%);
	background-size: 220% 100%;
	animation: app-gradient 3.2s linear infinite, app-glow 2.4s ease-in-out infinite;
	transition: transform .25s ease, box-shadow .25s ease;
}
.app-download:hover { text-decoration: none; transform: translateY(-1px) scale(1.06); animation-play-state: running; }
.app-download:active { transform: scale .96; }
.app-download svg { width: 12px; height: 12px; fill: currentColor; }
@keyframes app-gradient { 0% { background-position: 0% 50%; } 100% { background-position: 220% 50%; } }
@keyframes app-glow {
	0%, 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, .55), 0 2px 8px rgba(191, 90, 242, .45); }
	50% { box-shadow: 0 0 0 5px rgba(10, 132, 255, 0), 0 2px 14px rgba(255, 55, 95, .6); }
}

/* language picker */
.lang-picker { position: relative; }
.lang-toggle { background: none; border: 0; cursor: pointer; }
.lang-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.lang-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 210px;
	max-height: 70vh;
	overflow-y: auto;
	background: rgba(29, 29, 31, .96);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, .08);
	box-shadow: 0 18px 45px rgba(0, 0, 0, .5);
	padding: 8px;
	display: none;
}
.lang-panel.open { display: block; animation: panel-in .18s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.lang-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 8px;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: rgba(245, 245, 247, .9);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}
.lang-option:hover { background: rgba(255, 255, 255, .08); }
.lang-option.active { color: #2997ff; }
.lang-option .check { opacity: 0; font-size: 12px; }
.lang-option.active .check { opacity: 1; }

/* hamburger (mobile only) */
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 36px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 17px; height: 1px; background: currentColor; margin: 0 auto; transition: transform .3s; }
.nav-toggle.open span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* mobile menu */
.mobile-menu {
	position: fixed;
	top: var(--nav-height); left: 0; right: 0; bottom: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, .96);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	color: var(--color-text-light);
	padding: 12px 48px;
	transform: translateY(-110%);
	transition: transform .44s cubic-bezier(.32, .96, .5, .98);
	visibility: hidden;
	overflow-y: auto;
}
.mobile-menu.open { transform: none; visibility: visible; }
.mobile-menu-inner { display: flex; flex-direction: column; height: 100%; }
.mobile-menu ul { border-bottom: 1px solid rgba(255, 255, 255, .12); padding: 20px 0; }
.mobile-menu li a {
	display: block;
	color: var(--color-text-light);
	font-size: 17px;
	padding: 13px 0;
}
.mobile-menu-bottom { margin-top: auto; padding: 24px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.mobile-lang-select {
	background: #1d1d1f;
	color: #f5f5f7;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 10px;
	font-size: 15px;
	padding: 12px 14px;
	width: 100%;
}
.app-download-mobile { align-self: flex-start; font-size: 15px; padding: 12px 22px; }
.app-download-mobile svg { width: 15px; height: 15px; }

/* ================= RIBBON ================= */
.main { padding-top: var(--nav-height); }
.section-ribbon { background: linear-gradient(180deg, #e8f0fd 0%, #f5f5f7 100%); }
.ribbon-content {
	max-width: 980px;
	margin: 0 auto;
	padding: 14px 22px;
	text-align: center;
	font-size: 14px;
	color: var(--color-dark);
}
.ribbon-content sup { font-size: .7em; }
.ribbon-link { margin-left: 4px; color: var(--color-link); }
.ribbon-chevron { display: inline-block; transition: transform .2s; }
.ribbon-link:hover .ribbon-chevron { transform: translateX(2px); text-decoration: none; }

/* ================= TILES ================= */
.section-hero .tile-wrapper + .tile-wrapper { margin-top: 0; }
.tile-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #fff;
	color: var(--color-text);
}
.tile-wrapper.theme-dark { background: #000; color: var(--color-text-light); }

.tile-content {
	position: relative;
	z-index: 3;
	text-align: center;
	padding: 54px 22px 0;
}
.tile-copy-wrapper { max-width: 720px; margin: 0 auto; }
.typography-tile-headline {
	font-size: 56px;
	line-height: 1.07143;
	font-weight: 600;
	letter-spacing: -.015em;
	margin: 0;
}
.typography-tile-subhead {
	font-size: 28px;
	line-height: 1.14286;
	font-weight: 400;
	letter-spacing: .004em;
	margin: 6px 0 0;
}
.typography-tile-callout {
	font-size: 17px;
	line-height: 1.47;
	color: var(--color-gray);
	margin: 12px 0 0;
}
.theme-dark .typography-tile-callout { color: #a1a1a6; }
.tile-headline.logo-image { margin: 0; }
.tile-headline .headline img { height: 52px; width: auto; margin: 0 auto; }
.tile-ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
	margin-top: 18px;
}
.section-hero .tile-wrapper { min-height: 692px; }
.section-hero .tile-image-wrapper img { object-position: 50% 100%; }

/* split layout (Watch Series 12) */
.tile-content-split {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 48px;
	max-width: 880px;
	margin: 0 auto;
	padding-left: 22px;
	padding-right: 22px;
}
.tile-split-group { display: flex; flex-direction: column; }
.tile-split-group .typography-tile-subhead { font-size: 21px; text-align: left; margin-top: 0; }
.tile-split-group .tile-ctas { justify-content: flex-start; margin-top: 14px; }

/* tile imagery */
.tile-image-wrapper {
	position: absolute;
	z-index: 1;
	left: 0; right: 0; top: 0; bottom: 0;
}
.tile-image-wrapper picture,
.tile-image-wrapper img {
	width: 100%;
	height: 100%;
}
.tile-image-wrapper img { object-fit: cover; }

/* buttons */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	padding: 12px 21px;
	border-radius: 980px;
	background: var(--color-link);
	color: #fff;
	font-size: 17px;
	line-height: 1.17648;
	font-weight: 400;
	transition: background .25s, transform .2s;
	z-index: 4;
}
.button:hover { background: var(--color-link-hover); text-decoration: none; transform: scale(1.02); }
.button-secondary {
	background: transparent;
	color: var(--color-link);
	padding: 12px 8px;
}
.button-secondary:hover { background: transparent; color: var(--color-link-hover); text-decoration: underline; transform: none; }
.theme-dark .button-secondary { color: #2997ff; }
.theme-dark .button-secondary:hover { color: #4aa8ff; }

/* promo grid */
.section-promo {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	padding: 12px;
	background: #fff;
}
.section-promo .tile-wrapper { border-radius: 28px; min-height: 580px; }
.section-promo .tile-content { padding-top: 42px; }
.section-promo .typography-tile-headline { font-size: 40px; }
.section-promo .typography-tile-subhead { font-size: 21px; }
.section-promo .tile-headline .headline img { height: 40px; }
.section-promo .button { font-size: 14px; padding: 9px 18px; }
.section-promo .button-secondary { padding: 9px 6px; }
.section-promo .tile-ctas { gap: 14px; margin-top: 15px; }

/* ================= GALLERIES ================= */
.section-endless-entertainment-gallery { background: #fff; padding-bottom: 40px; }
.media-gallery-headline-container { max-width: 1440px; margin: 0 auto; padding: 48px 22px 20px; }
.media-gallery-headline {
	font-size: 28px;
	line-height: 1.14;
	font-weight: 600;
	letter-spacing: .004em;
	margin: 0;
}
.gallery-block {
	position: relative;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 14px;
}
.fam-block { margin-top: 12px; }
.media-gallery {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: #000;
}
.media-gallery-track {
	display: flex;
	transition: transform .6s cubic-bezier(.36, .07, .19, 1);
}
.media-gallery-item {
	position: relative;
	flex: 0 0 100%;
	height: 560px;
	overflow: hidden;
}
.fam-media-gallery .media-gallery-item { flex: 0 0 33.3333%; border-left: 12px solid #fff; }
.fam-media-gallery .media-gallery-item:first-child { border-left: 0; }
.media-gallery-bg { position: absolute; inset: 0; }
.media-gallery-bg img { width: 100%; height: 100%; object-fit: cover; }
.media-gallery-bg-music { background: #000; }
.media-gallery-bg-music img { object-fit: contain; padding: 0; width: 70%; height: 70%; margin: 15% auto; }
.media-gallery-contents {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 36px 40px;
	color: #fff;
	pointer-events: none;
}
.media-gallery-contents .button,
.media-gallery-contents a { pointer-events: auto; }
.tv-gallery-top-content { display: flex; flex-direction: column; gap: 12px; min-height: 44px; }
.tv-gallery-atvplus-logo img { height: 20px; width: auto; }
.tv-gallery-media-logo img { max-height: 34px; width: auto; max-width: 200px; object-fit: contain; object-position: left; }
.media-gallery-bottom-content { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.media-gallery-button {
	background: rgba(255, 255, 255, .95);
	color: #000;
	border-radius: 980px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 500;
}
.media-gallery-longnote {
	margin: 0;
	font-size: 19px;
	line-height: 1.21;
	font-weight: 600;
	letter-spacing: .01em;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.media-gallery-longnote .media-gallery-genre {
	display: block;
	font-size: 13px;
	font-weight: 400;
	opacity: .82;
	text-transform: uppercase;
	letter-spacing: .12em;
	margin-bottom: 3px;
}
/* FAM services */
.media-gallery-logo { color: #fff; }
.media-gallery-logo svg { width: auto; height: 30px; fill: currentColor; }
.fam-media-gallery .media-gallery-contents { padding: 28px 30px; }
.fam-media-gallery .media-gallery-longnote { font-size: 17px; }

/* dots */
.dotnav {
	position: absolute;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(0, 0, 0, .38);
	border-radius: 980px;
	padding: 8px 14px;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.dotnav-items { display: flex; align-items: center; gap: 9px; }
.dotnav-link {
	display: block;
	width: 8px; height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .45);
	transition: all .3s;
	cursor: pointer;
}
.dotnav-link:hover { background: rgba(255, 255, 255, .85); }
.dotnav-link.active { width: 18px; border-radius: 980px; background: #fff; }
.dotnav-iconcontrol {
	display: none;
	width: 22px; height: 22px;
	border: 0;
	padding: 0;
	margin-left: 4px;
	background: none;
	cursor: pointer;
}
.dotnav-iconcontrol svg { width: 100%; height: 100%; fill: #fff; }
.dotnav[data-has-autoplay="true"] .dotnav-iconcontrol { display: block; }
.dotnav .icon-pause { display: block; }
.dotnav .icon-play { display: none; }
.dotnav.paused .icon-pause { display: none; }
.dotnav.paused .icon-play { display: block; }
.fam-block .dotnav { background: rgba(29, 29, 31, .5); bottom: 14px; }

/* ================= FOOTER ================= */
.footer {
	background: var(--color-bg-alt);
	color: #6e6e73;
	font-size: 12px;
	line-height: 1.5;
}
.footer-content { max-width: 980px; margin: 0 auto; padding: 20px 22px; }
.footer-note { border-bottom: 1px solid #d2d2d7; padding: 17px 0; }
.footer-note p { margin: 0 0 10px; }
.footer-note p:last-child { margin-bottom: 0; }
.footer-directory {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 24px 20px;
	padding: 20px 0;
	border-bottom: 1px solid #d2d2d7;
}
.footer-column h3 {
	font-size: 12px;
	color: #1d1d1f;
	margin: 0 0 10px;
	font-weight: 600;
}
.footer-column .footer-subtitle { margin-top: 22px; }
.footer-column ul { margin-bottom: 6px; }
.footer-column li { margin-bottom: 8px; }
.footer-column a { color: #424245; }
.footer-column a:hover { color: #000; text-decoration: underline; }
.footer-legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 18px;
	padding: 17px 0 22px;
}
.footer-legal-copyright { margin: 0; }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 9px 18px; }
.footer-legal-links li:not(:last-child) { border-right: 1px solid #d2d2d7; padding-right: 18px; }
.footer-locale { margin-left: auto; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1068px) {
	.globalnav-list { padding: 0 20px; }
	.globalnav-link { padding: 0 6px; font-size: 11px; }
	.app-download-nav { padding: 5px 10px; }
	.section-hero .tile-wrapper { min-height: 650px; }
	.typography-tile-headline { font-size: 44px; }
	.typography-tile-subhead { font-size: 24px; }
	.section-promo .tile-wrapper { min-height: 490px; }
	.section-promo .typography-tile-headline { font-size: 32px; }
	.media-gallery-item { height: 500px; }
	.fam-media-gallery .media-gallery-item { flex: 0 0 33.3333%; }
	.footer-directory { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 833px) {
	.globalnav-list { display: none; }
	.nav-toggle { display: inline-flex; }
}

@media (max-width: 734px) {
	.globalnav-content { padding: 0 16px; }
	.app-download-nav { padding: 5px 10px; font-size: 11px; }
	.app-download-nav span { display: none; }
	.app-download-nav { padding: 6px; }
	.app-download-nav svg { width: 14px; height: 14px; }
	.globalnav-right { gap: 2px; }
	.ribbon-content { font-size: 13px; padding: 12px 32px; }

	.section-hero .tile-wrapper { min-height: 500px; }
	.tile-content { padding-top: 42px; }
	.typography-tile-headline { font-size: 32px; }
	.typography-tile-subhead { font-size: 19px; }
	.typography-tile-callout { font-size: 14px; }
	.tile-headline .headline img { height: 38px; }
	.tile-ctas { gap: 12px; }
	.button { font-size: 15px; padding: 10px 18px; }

	.tile-content-split { flex-direction: column; gap: 12px; }
	.tile-split-group .typography-tile-subhead { text-align: center; font-size: 19px; }
	.tile-split-group .tile-ctas { justify-content: center; }

	.section-promo { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
	.section-promo .tile-wrapper { min-height: 455px; border-radius: 20px; }
	.section-promo .typography-tile-headline { font-size: 28px; }
	.section-promo .typography-tile-subhead { font-size: 17px; }
	.section-promo .tile-headline .headline img { height: 32px; }

	.media-gallery-headline-container { padding: 36px 16px 14px; }
	.media-gallery-headline { font-size: 22px; }
	.gallery-block { padding: 0 12px; }
	.media-gallery { border-radius: 14px; }
	.media-gallery-item { height: 420px; }
	.fam-media-gallery .media-gallery-item { flex: 0 0 100%; border-left: 0; }
	.media-gallery-contents { padding: 26px 24px; }
	.fam-media-gallery .media-gallery-contents { padding: 22px; }
	.media-gallery-longnote { font-size: 16px; }
	.tv-gallery-media-logo img { max-height: 26px; }

	.footer-directory { grid-template-columns: repeat(2, 1fr); gap: 18px 16px; }
	.footer-locale { margin-left: 0; width: 100%; }
	.footer-legal-links li:not(:last-child) { border-right: 0; padding-right: 0; }
}

@media (max-width: 400px) {
	.footer-directory { grid-template-columns: 1fr; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.app-download { animation: none; }
	.media-gallery-track { transition: none; }
	html { scroll-behavior: auto; }
}
