/* Tidal Breath: extra styling. Colours and fonts come from theme.json. */

:root {
	--tb-abyss: var(--wp--preset--color--abyss, #0B1F2E);
	--tb-harbour: var(--wp--preset--color--harbour, #12304A);
	--tb-line: var(--wp--preset--color--line, #1F4A6B);
	--tb-shallows: var(--wp--preset--color--shallows, #4FD1C5);
	--tb-foam: var(--wp--preset--color--foam, #A8EDE6);
	--tb-sand: var(--wp--preset--color--sand, #F2D6A2);
	--tb-text: var(--wp--preset--color--text, #E8F3F5);
	--tb-muted: var(--wp--preset--color--muted, #A9C3CE);
	--tb-on: var(--wp--preset--color--on-accent, #062A2A);
	--tb-display: var(--wp--preset--font-family--sora, Sora, system-ui, sans-serif);
	--tb-radius: 24px;
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body.tb-site {
	background:
		radial-gradient(1100px 620px at 85% -8%, rgba(79, 209, 197, 0.10), transparent 62%),
		radial-gradient(900px 520px at -10% 28%, rgba(31, 74, 107, 0.38), transparent 62%),
		var(--tb-abyss);
	-webkit-font-smoothing: antialiased;
}

.tb-skip {
	position: absolute; left: -999px; top: 0; z-index: 1000;
	background: var(--tb-sand); color: var(--tb-abyss);
	padding: .75rem 1.25rem; border-radius: 0 0 12px 0; font-weight: 600; text-decoration: none;
}
.tb-skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--tb-sand); outline-offset: 3px; border-radius: 6px; }

.tb-sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky; top: 0; z-index: 50;
	background: rgba(11, 31, 46, 0.72);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border-bottom: 1px solid rgba(31, 74, 107, 0.6);
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }

.tb-brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--tb-text); font-family: var(--tb-display); font-weight: 700; letter-spacing: -0.01em; }
.tb-brand img, .tb-brand svg { width: 34px; height: 34px; border-radius: 9px; display: block; }
.tb-header-cta .wp-block-button__link { padding: .55rem 1.1rem !important; font-size: .9375rem !important; }

/* Eyebrow, lead, sections */
.tb-section { padding-block: var(--wp--preset--spacing--70); }
.tb-section--tight { padding-block: var(--wp--preset--spacing--60); }
.tb-eyebrow {
	font-family: var(--tb-display); font-size: .8125rem; letter-spacing: .22em;
	text-transform: uppercase; color: var(--tb-shallows); font-weight: 600; margin: 0 0 .5rem;
}
.tb-lead { font-size: var(--wp--preset--font-size--medium); color: var(--tb-muted); max-width: 62ch; }
.tb-center { text-align: center; margin-inline: auto; }
.tb-muted { color: var(--tb-muted); }
.tb-small { font-size: .875rem; }
.tb-note { font-size: .875rem; color: var(--tb-muted); border-left: 3px solid var(--tb-line); padding-left: 1rem; }

/* Reveal on scroll */
html.tb-js .tb-reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
html.tb-js .tb-reveal.is-in { opacity: 1; transform: none; }

/* Chips and badges */
.tb-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.tb-chip {
	border: 1px solid var(--tb-line); border-radius: 999px; padding: .35rem .95rem;
	font-size: .875rem; color: var(--tb-muted); background: rgba(18, 48, 74, 0.6);
}
.tb-badge {
	display: inline-block; font-family: var(--tb-display); font-size: .75rem; font-weight: 600;
	border-radius: 10px; padding: .2rem .7rem; letter-spacing: .01em; line-height: 1.5; white-space: nowrap;
}
.tb-badge--well-studied { background: #A8EDE6; color: #062A2A; }
.tb-badge--promising { background: #F2D6A2; color: #0B1F2E; }
.tb-badge--early { background: #1F4A6B; color: #E8F3F5; }

/* Buttons */
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
	box-shadow: 0 10px 34px -10px rgba(79, 209, 197, 0.55);
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
	text-decoration: none;
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(79, 209, 197, 0.7); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; color: var(--tb-text); border: 1px solid var(--tb-line); box-shadow: none; text-decoration: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--tb-shallows); color: var(--tb-foam); background: rgba(79, 209, 197, 0.06); }
.tb-btn-soon {
	display: inline-block; font-family: var(--tb-display); font-weight: 600; padding: .9rem 1.75rem; border-radius: 999px;
	border: 1px dashed var(--tb-line); color: var(--tb-muted); background: rgba(18, 48, 74, 0.4);
}

.tb-btn {
	font-family: var(--tb-display); font-weight: 600; font-size: 1rem; min-height: 52px; padding: 0 1.75rem;
	border-radius: 999px; border: 0; background: var(--tb-shallows); color: var(--tb-on); cursor: pointer;
	box-shadow: 0 10px 34px -10px rgba(79, 209, 197, 0.55); transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.tb-btn:hover { background: var(--tb-foam); transform: translateY(-2px); }
.tb-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.tb-btn--ghost { background: transparent; color: var(--tb-text); border: 1px solid var(--tb-line); box-shadow: none; }
.tb-btn--ghost:hover { background: rgba(79, 209, 197, 0.08); border-color: var(--tb-shallows); color: var(--tb-foam); }

/* Cards */
.tb-card {
	background: linear-gradient(180deg, rgba(18, 48, 74, 0.88), rgba(18, 48, 74, 0.55));
	border: 1px solid rgba(31, 74, 107, 0.9); border-radius: var(--tb-radius);
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -34px rgba(0, 0, 0, 0.7);
}
.tb-card > :first-child { margin-top: 0; }
.tb-card > :last-child { margin-bottom: 0; }
.tb-grid { display: grid; gap: 1.25rem; }
.tb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .tb-grid--3 { grid-template-columns: 1fr; } .tb-grid--2 { grid-template-columns: 1fr; } }

/* Hero */
.tb-hero { position: relative; overflow: hidden; padding-top: clamp(2rem, 6vh, 4rem); padding-bottom: 0; isolation: isolate; }
.tb-hero__grid {
	display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 5rem);
	align-items: center; max-width: 1200px; margin-inline: auto; padding-bottom: clamp(7rem, 16vh, 11rem);
}
@media (max-width: 880px) { .tb-hero__grid { grid-template-columns: 1fr; } }
.tb-hero__glow {
	position: absolute; z-index: -1; width: 900px; height: 900px; right: -200px; top: -120px; border-radius: 50%;
	background: radial-gradient(circle, rgba(79, 209, 197, 0.22) 0%, rgba(79, 209, 197, 0.06) 40%, transparent 68%);
	animation: tb-breathe-glow 11s ease-in-out infinite;
}
.tb-hero__moon {
	position: absolute; z-index: -1; right: 12%; top: 10%; width: 44px; height: 44px; border-radius: 50%;
	background: var(--tb-sand); box-shadow: 0 0 60px 14px rgba(242, 214, 162, 0.35);
}
.tb-hero h1 { margin: 0 0 1.25rem; }
.tb-hero h1 em { font-style: normal; color: var(--tb-shallows); }
.tb-hero .tb-lead { margin-bottom: 1.75rem; }
@keyframes tb-breathe-glow { 0%, 100% { transform: scale(0.92); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }

/* Waves */
.tb-waves { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(110px, 18vh, 190px); overflow: hidden; z-index: 0; pointer-events: none; }
.tb-waves__layer { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: tb-drift 28s linear infinite; }
.tb-waves__layer svg { width: 100%; height: 100%; display: block; }
.tb-waves__layer--2 { animation-duration: 40s; animation-direction: reverse; opacity: .7; }
.tb-waves__layer--3 { animation-duration: 56s; opacity: .5; }
@keyframes tb-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tb-divider { line-height: 0; }
.tb-divider svg { display: block; width: 100%; height: 56px; }

/* Orb */
.tb-orb { position: relative; width: min(520px, 86vw); aspect-ratio: 1; margin-inline: auto; }
.tb-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tb-orb__label {
	position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none;
	font-family: var(--tb-display); color: var(--tb-text); transition: color .35s ease;
}
.tb-orb.is-over-water .tb-orb__label { color: var(--tb-on); }
.tb-orb__phase { font-weight: 700; font-size: clamp(1.75rem, 6vw, 2.9rem); letter-spacing: -0.02em; line-height: 1.1; }
.tb-orb__count { font-weight: 600; font-size: clamp(1.1rem, 3.4vw, 1.6rem); opacity: .9; margin-top: .15rem; }
.tb-orb--sm { width: min(300px, 70vw); }

/* Idea section */
.tb-phase { position: relative; padding: 2rem 1.5rem 1.75rem; }
.tb-phase__art { height: 120px; margin-bottom: 1rem; }
.tb-phase__art svg { width: 100%; height: 100%; display: block; }
.tb-phase h3 { margin: 0 0 .35rem; }
.tb-phase p { margin: 0; color: var(--tb-muted); }

/* Try it demo */
.tb-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 900px) { .tb-demo { grid-template-columns: 1fr; } }
.tb-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.tb-tab {
	font-family: var(--tb-display); font-weight: 600; font-size: .9375rem; min-height: 44px; padding: 0 1.1rem;
	border-radius: 999px; border: 1px solid var(--tb-line); background: transparent; color: var(--tb-text); cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}
.tb-tab:hover { border-color: var(--tb-shallows); }
.tb-tab[aria-selected="true"] { background: var(--tb-shallows); border-color: var(--tb-shallows); color: var(--tb-on); }
.tb-demo__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .75rem; }
.tb-demo__pattern { font-family: var(--tb-display); color: var(--tb-foam); font-weight: 600; }
.tb-demo__title { margin: 0 0 .5rem; }
.tb-demo__text { color: var(--tb-muted); margin: 0 0 1rem; }
.tb-demo__spark { display: block; width: 100%; height: 48px; margin: .5rem 0 1.25rem; }
.tb-demo__spark path { fill: none; stroke: var(--tb-shallows); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tb-demo__actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.tb-gate { border: 1px solid rgba(242, 214, 162, 0.5); background: rgba(242, 214, 162, 0.07); border-radius: 16px; padding: 1rem 1.1rem; margin: 0 0 1rem; font-size: .9375rem; }
.tb-gate p { margin: 0 0 .75rem; color: var(--tb-text); }
.tb-gate label { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; font-weight: 500; }
.tb-gate input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--tb-shallows); flex: none; }
.tb-demo__time { font-size: .875rem; color: var(--tb-muted); }

/* Watch mockup */
.tb-watchwrap { position: relative; display: grid; place-items: center; padding: 2rem 0; }
.tb-watch {
	position: relative; width: 240px; height: 290px; border-radius: 64px; background: #000; border: 10px solid #1d2f3b;
	box-shadow: 0 0 0 2px #2a4352, 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 90px -20px rgba(79, 209, 197, 0.35);
	overflow: hidden; display: grid; place-items: center;
}
.tb-watch::after { content: ""; position: absolute; right: -16px; top: 74px; width: 8px; height: 46px; border-radius: 4px; background: #2a4352; }
.tb-watch__inner { display: grid; justify-items: center; gap: .3rem; font-family: var(--tb-display); }
.tb-watch__top { display: flex; justify-content: space-between; width: 190px; font-size: .75rem; color: var(--tb-muted); font-family: var(--tb-display); }
.tb-watch svg { display: block; }
.tb-watch__phase { position: relative; height: 1.4rem; width: 6rem; text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--tb-text); }
.tb-watch__phase span { position: absolute; inset: 0; opacity: 0; }
.tb-watch__in { animation: tb-showin 11s ease-in-out infinite; }
.tb-watch__out { animation: tb-showout 11s ease-in-out infinite; }
@keyframes tb-showin { 0%, 47% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes tb-showout { 0%, 47% { opacity: 0; } 50%, 97% { opacity: 1; } 100% { opacity: 0; } }
.tb-watch__bottom { font-size: .8125rem; color: var(--tb-sand); font-weight: 600; }
.tb-water { animation: tb-tide 11s ease-in-out infinite; }
@keyframes tb-tide { 0%, 100% { transform: translateY(46px); } 50% { transform: translateY(-14px); } }
.tb-wavex { animation: tb-slide 7s linear infinite; }
@keyframes tb-slide { from { transform: translateX(0); } to { transform: translateX(-80px); } }

.tb-taps { position: absolute; inset: -30px; pointer-events: none; }
.tb-taps circle { fill: var(--tb-sand); opacity: 0; animation: tb-tap 11s linear infinite; }
@keyframes tb-tap { 0% { opacity: 0; r: 2; } 1.2% { opacity: 1; r: 5; } 4% { opacity: 0; r: 9; } 100% { opacity: 0; } }

.tb-strip { width: 100%; height: 86px; }
.tb-strip .tb-playhead { animation: tb-play 11s linear infinite; }
@keyframes tb-play { from { transform: translateX(0); } to { transform: translateX(560px); } }

/* Haptic table */
.tb-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tb-table th, .tb-table td { text-align: left; padding: .75rem .85rem; border-bottom: 1px solid var(--tb-line); vertical-align: top; }
.tb-table th { font-family: var(--tb-display); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tb-shallows); }
.tb-tablewrap { overflow-x: auto; }

/* Science */
.tb-toc { position: sticky; top: 72px; z-index: 20; display: flex; gap: .5rem; overflow-x: auto; padding: .75rem 0; margin: 0; list-style: none; scrollbar-width: none;
	background: linear-gradient(180deg, var(--tb-abyss) 60%, transparent); }
.admin-bar .tb-toc { top: 104px; }
.tb-toc::-webkit-scrollbar { display: none; }
.tb-toc a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--tb-line); color: var(--tb-muted); font-size: .875rem; text-decoration: none; background: rgba(18, 48, 74, 0.7); }
.tb-toc a:hover { color: var(--tb-text); border-color: var(--tb-shallows); }

.tb-study { display: flex; flex-direction: column; gap: .6rem; }
.tb-study__tag { font-family: var(--tb-display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--tb-sand); margin: 0; font-weight: 600; }
.tb-study h3 { margin: 0; font-size: 1.3rem; }
.tb-study__row { margin: 0; color: var(--tb-muted); font-size: .9375rem; }
.tb-study__row strong { color: var(--tb-text); font-weight: 600; }
.tb-stat { font-family: var(--tb-display); font-weight: 700; font-size: clamp(2.25rem, 5vw, 3.4rem); line-height: 1; color: var(--tb-foam); margin: 0; letter-spacing: -0.03em; }
.tb-stat small { display: block; font-size: .875rem; font-weight: 500; letter-spacing: 0; color: var(--tb-muted); margin-top: .5rem; }
.tb-study__link { margin-top: auto !important; font-size: .9375rem; }

.tb-schematic { padding: 1rem 1rem .5rem; }
.tb-schematic svg { width: 100%; height: auto; display: block; }
.tb-schematic figcaption { font-size: .8125rem; color: var(--tb-muted); padding: .5rem 0 .25rem; }
.tb-schematic .tb-playhead { animation: tb-play-rsa 22s linear infinite; }
@keyframes tb-play-rsa { from { transform: translateX(0); } to { transform: translateX(660px); } }

.tb-rate { display: grid; gap: 1rem; }
.tb-rate input[type="range"] { width: 100%; accent-color: var(--tb-shallows); height: 44px; }
.tb-rate__out { display: flex; flex-wrap: wrap; gap: .5rem 2rem; font-family: var(--tb-display); }
.tb-rate__out strong { color: var(--tb-foam); font-size: 1.5rem; }
.tb-rate__out span { color: var(--tb-muted); font-size: .9375rem; }

.tb-ladder { display: grid; gap: .75rem; }
.tb-ladder__row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem 1.1rem; border: 1px solid var(--tb-line); border-radius: 18px; background: rgba(18, 48, 74, 0.45); }
.tb-ladder__row h4 { margin: 0; }
.tb-ladder__row p { margin: 0; color: var(--tb-muted); font-size: .9375rem; }
@media (max-width: 640px) { .tb-ladder__row { grid-template-columns: 1fr; } }

.tb-tech { display: grid; gap: 1rem; }
.tb-tech__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.tb-tech__head h3 { margin: 0; }
.tb-tech__spark { width: 100%; height: 44px; display: block; }
.tb-tech__spark path { fill: none; stroke: var(--tb-shallows); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tb-tech h4 { margin: 0 0 .25rem; font-size: 1rem; color: var(--tb-foam); }
.tb-tech p { margin: 0; color: var(--tb-muted); font-size: .9375rem; }
.tb-tech ul { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .9375rem; color: var(--tb-muted); }
.tb-tech__safety { border-left: 3px solid var(--tb-sand); padding-left: 1rem; }

.tb-sources li { margin-bottom: .6rem; font-size: .9375rem; color: var(--tb-muted); }
.tb-sources a { overflow-wrap: anywhere; }

.tb-callout { border: 1px solid rgba(242, 214, 162, 0.45); background: rgba(242, 214, 162, 0.07); border-radius: 18px; padding: 1.1rem 1.25rem; }
.tb-callout > :first-child { margin-top: 0; } .tb-callout > :last-child { margin-bottom: 0; }

/* Features */
.tb-feature { display: grid; gap: .5rem; }
.tb-feature h3 { margin: 0; font-size: 1.15rem; }
.tb-feature p { margin: 0; color: var(--tb-muted); font-size: .9375rem; }
.tb-feature__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(79, 209, 197, 0.12); color: var(--tb-shallows); margin-bottom: .25rem; }
.tb-feature__icon svg { width: 22px; height: 22px; }

/* Post cards and journal */
.tb-postcard { border: 1px solid var(--tb-line); border-radius: 22px; padding: 1.5rem; background: rgba(18, 48, 74, 0.5); height: 100%; transition: border-color .2s ease, transform .2s ease; }
.tb-postcard:hover { border-color: var(--tb-shallows); transform: translateY(-3px); }
.tb-postcard .wp-block-post-title a { text-decoration: none; color: var(--tb-text); }
.tb-postcard .wp-block-post-title { margin: 0 0 .5rem; font-size: 1.3rem; }
.tb-postcard .wp-block-post-date { color: var(--tb-muted); font-size: .8125rem; margin-bottom: .5rem; }
.tb-postcard .wp-block-post-excerpt { color: var(--tb-muted); font-size: .9375rem; }
.tb-tryit { border: 1px solid var(--tb-line); border-radius: 22px; background: linear-gradient(180deg, rgba(79,209,197,.10), rgba(18,48,74,.5)); padding: 1.5rem; margin-top: 3rem; }
.tb-tryit > :first-child { margin-top: 0; } .tb-tryit > :last-child { margin-bottom: 0; }

/* CTA */
.tb-cta { position: relative; overflow: hidden; text-align: center; border-radius: 32px; padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 5vw, 3rem); border: 1px solid var(--tb-line); background: radial-gradient(700px 360px at 50% 0%, rgba(79, 209, 197, 0.18), transparent 70%), var(--tb-harbour); }
.tb-cta h2 { margin-top: 0; }

/* Footer */
footer.wp-block-template-part { border-top: 1px solid rgba(31, 74, 107, 0.7); background: rgba(7, 20, 30, 0.55); }
.tb-footer a { color: var(--tb-muted); text-decoration: none; }
.tb-footer a:hover { color: var(--tb-text); text-decoration: underline; }

/* Content pages */
.wp-block-post-content :where(h2) { margin-top: 2.5rem; }
.wp-block-post-content :where(ul, ol) { padding-left: 1.25rem; }
.wp-block-post-content :where(li) { margin-bottom: .4rem; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	html.tb-js .tb-reveal { opacity: 1; transform: none; }
}
