/*
Theme Name: Two Sun Traders
Theme URI: https://twosuntraders.com
Author: Two Sun Traders LLC
Description: Aurora design for the Two Sun Traders studio site. Dark background, drifting sunset glows that change color as you scroll, and a Portfolio (App) post type with category and platform filters.
Version: 2.3.0
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: two-sun-traders
*/

:root {
	--bg: #0b0d1a;
	--bg-2: #121528;
	--ink: #f6f1ea;
	--muted: #b7b0c2;
	--line: rgba(255, 255, 255, 0.09);
	--card: rgba(255, 255, 255, 0.04);
	--sun: #ffd35c;
	--amber: #ff9a2e;
	--ember: #e8551c;
	--navy: #1c2a6b;
	--plum: #6b2f5c;
	/* glow colors — main.js swaps these per section */
	--g1: #ff9a2e;
	--g2: #e8551c;
	--g3: #1c2a6b;
	--radius: 18px;
	--max: 1180px;
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Fraunces", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sun); text-decoration: none; }
a:hover { color: #fff; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ---------- Aurora glow layer ---------- */
.aurora {
	position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
	background: radial-gradient(ellipse at 50% 120%, var(--bg-2), var(--bg) 70%);
}
.orb {
	position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
	transition: background-color 1.4s ease;
	will-change: transform;
}
.orb-1 { width: 52vw; height: 52vw; top: -12vw; left: -10vw; background: var(--g1); animation: drift1 26s ease-in-out infinite alternate; }
.orb-2 { width: 44vw; height: 44vw; bottom: -14vw; right: -8vw; background: var(--g2); animation: drift2 32s ease-in-out infinite alternate; }
.orb-3 { width: 38vw; height: 38vw; top: 35%; left: 40%; background: var(--g3); opacity: .45; animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vw, 10vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-12vw, -14vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(-18vw, 8vh) scale(1.15); } }
.grain {
	position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
	.orb { animation: none; }
	html { scroll-behavior: auto; }
	.reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Layout ---------- */
.wrap { width: min(var(--max), 100% - 48px); margin-inline: auto; }
section { padding: 110px 0; position: relative; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--amber); margin-bottom: 14px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0 0 18px; letter-spacing: -.01em; }
h1 { font-size: clamp(42px, 7vw, 86px); }
h2 { font-size: clamp(32px, 4.4vw, 52px); }
h3 { font-size: 22px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 640px; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { color: var(--muted); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	background: rgba(11, 13, 26, .55);
	border-bottom: 1px solid transparent;
	transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(11, 13, 26, .8); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; letter-spacing: .01em; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 30px; align-items: center; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.nav .btn { color: #1a0f05; }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); font-size: 26px; cursor: pointer; }

.btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
	background: linear-gradient(135deg, var(--sun), var(--amber));
	color: #1a0f05; border: 0; cursor: pointer;
	box-shadow: 0 8px 30px rgba(255, 154, 46, .28);
	transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 38px rgba(255, 154, 46, .4); color: #1a0f05; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { color: var(--ink); border-color: rgba(255,255,255,.3); box-shadow: none; }

/* ---------- Hero ---------- */
.hero { padding: 120px 0 90px; min-height: calc(100vh - 72px); display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 60px; align-items: center; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--sun), var(--amber) 55%, var(--ember)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-art img { width: 100%; max-width: 440px; margin-left: auto; border-radius: 50%; box-shadow: 0 40px 120px rgba(232, 85, 28, .35); animation: float 9s ease-in-out infinite alternate; }
@keyframes float { to { transform: translateY(-16px) rotate(-1.5deg); } }
.clients { margin-top: 42px; color: var(--muted); font-size: 14px; }
.clients strong { color: var(--ink); font-weight: 600; }

/* ---------- Stats ---------- */
.stats { padding: 0; }
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); backdrop-filter: blur(10px); }
.stat { padding: 30px 26px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--display); font-size: 40px; line-height: 1; margin-bottom: 8px; color: var(--sun); }
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- Featured ---------- */
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.feature-card {
	position: relative; border-radius: 24px; overflow: hidden; min-height: 340px;
	border: 1px solid var(--line); background: var(--card); color: var(--ink);
	display: flex; flex-direction: column; justify-content: flex-end;
	transition: transform .35s ease, border-color .35s;
}
.feature-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--ink); }
.feature-card .media { position: absolute; inset: 0; }
.feature-card .media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .4s, transform .6s; }
.feature-card:hover .media img { opacity: .75; transform: scale(1.04); }
.feature-card .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(11,13,26,.95)); }
.feature-card .body { position: relative; padding: 30px; }
.feature-card .body p { color: var(--muted); margin: 0; font-size: 15px; }

.placeholder-art { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 70%, #fff 0%), transparent 60%), radial-gradient(circle at 75% 75%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%), var(--bg-2); font-family: var(--display); font-size: 80px; color: rgba(255,255,255,.85); }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--ink); }
.badge.cat { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Portfolio grid ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 34px; }
.filter { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; transition: all .2s; }
.filter:hover { color: var(--ink); border-color: rgba(255,255,255,.25); }
.filter.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.app-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; transition: transform .3s, border-color .3s, opacity .3s; }
.app-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.app-card.hidden { display: none; }
.app-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.app-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.app-card .thumb .placeholder-art { font-size: 54px; }
.app-card .info { padding: 18px 20px 22px; }
.app-card h3 { font-family: var(--font); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.app-card p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.5; }
.empty-note { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px; }

/* ---------- Approach ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font-family: var(--display); font-size: 30px; color: var(--amber); margin-bottom: 16px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }
.stack { margin-top: 40px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: start; }
.contact-form { display: grid; gap: 16px; padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); backdrop-filter: blur(10px); }
.contact-form label { font-size: 13px; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
.contact-form input, .contact-form textarea {
	font: inherit; color: var(--ink); background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,154,46,.2); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 12px; font-size: 15px; }
.notice.ok { background: rgba(80, 200, 120, .12); border: 1px solid rgba(80,200,120,.35); }
.notice.err { background: rgba(232, 85, 28, .14); border: 1px solid rgba(232,85,28,.4); }

/* ---------- Single app / generic content ---------- */
.single-hero { padding: 90px 0 40px; }
.single-hero .back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.single-media { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 50px; }
.entry { max-width: 760px; }
.entry p, .entry li { color: #ddd6e4; }
.entry img { border-radius: 14px; margin: 24px 0; }
.entry h2 { font-size: 32px; margin-top: 40px; }
.store-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0; }
.post-list { display: grid; gap: 18px; }
.post-item { padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.post-item h2 { font-size: 26px; margin-bottom: 8px; }
.post-item h2 a { color: var(--ink); }
.pagination { margin-top: 30px; display: flex; gap: 10px; }

.app-head { display: flex; gap: 32px; align-items: center; }
.app-icon { flex: 0 0 auto; width: 148px; height: 148px; border-radius: 22%; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px color-mix(in srgb, var(--accent) 35%, transparent); background: var(--bg-2); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-head h1 { font-size: clamp(32px, 4.6vw, 54px); margin-bottom: 10px; }
.app-head .store-links { margin: 18px 0 0; }
.entry iframe, .entry video { max-width: 100%; }
.entry table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry blockquote { border-left: 3px solid var(--amber); margin: 24px 0; padding: 4px 20px; color: var(--muted); }
.entry figure { margin: 24px 0; }
.entry .wp-block-embed__wrapper iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 14px; }
@media (max-width: 760px) { .app-head { flex-direction: column; align-items: flex-start; gap: 20px; } .app-icon { width: 104px; height: 104px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inner .brand img { width: 30px; height: 30px; border-radius: 50%; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.hero-grid, .contact-grid { grid-template-columns: 1fr; }
	.hero-art { order: -1; }
	.hero-art img { max-width: 260px; margin: 0; }
	.steps { grid-template-columns: repeat(2, 1fr); }
	.featured-grid { grid-template-columns: 1fr; }
	.stats-bar { grid-template-columns: repeat(2, 1fr); }
	.stat:nth-child(2) { border-right: 0; }
	.stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
	section { padding: 80px 0; }
	.hero { padding-top: 60px; min-height: auto; }
	.nav-toggle { display: block; }
	.nav { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(11,13,26,.97); border-bottom: 1px solid var(--line); display: none; padding: 10px 0 20px; }
	.nav.open { display: flex; }
	.nav a { padding: 12px 24px; width: 100%; text-align: center; }
	.nav .btn { width: auto; margin-top: 8px; }
	.steps { grid-template-columns: 1fr; }
}
