/* PlugWren — "paper & ping" design.
   Warm paper background, ink type, indigo brand, orange ping accent. */
:root {
	--paper: #f6f2ea;
	--paper-2: #efe9dd;
	--card: #fffdf9;
	--ink: #16131f;
	--ink-2: #3d3849;
	--muted: #6b6475;
	--line: #e3dccd;
	--brand: #4338ca;
	--brand-2: #6366f1;
	--sky: #0ea5e9;
	--ping: #f97316;
	--ping-soft: #ffedd5;
	--night: #14112a;
	--night-2: #1e1a3d;
	--radius: 22px;
	--max: 1160px;
	--display: "Fraunces", Georgia, "Times New Roman", serif;
	--body: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
	--ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--body);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
/* subtle paper grain */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	opacity: .35;
	background-image: radial-gradient(rgba(22, 19, 31, .06) 1px, transparent 1px);
	background-size: 22px 22px;
}
main, header, footer { position: relative; z-index: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
:focus-visible { outline: 3px solid var(--ping); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(246, 242, 234, .78);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--ink); text-decoration: none; letter-spacing: -.3px; }
.logo-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--ping); }
.logo-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ping); opacity: 0; animation: ripple 2.8s var(--ease) infinite; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 14px; border-radius: 99px; white-space: nowrap; transition: background .2s, color .2s; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.cta { background: var(--ink); color: var(--paper); }
.nav a.cta:hover { background: var(--brand); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 24px;
	border-radius: 14px;
	font-weight: 600;
	font-size: 16px;
	font-family: var(--body);
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 0 6px 0 -1px var(--brand); }
.btn-ink:hover { box-shadow: 0 9px 0 -1px var(--brand); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.hero h1 {
	font-family: var(--display);
	font-size: clamp(42px, 6.2vw, 78px);
	line-height: 1.02;
	letter-spacing: -1.5px;
	margin: 0 0 24px;
	font-weight: 600;
	font-variation-settings: "SOFT" 100, "WONK" 1;
}
.hero h1 .scribble { position: relative; white-space: nowrap; color: var(--brand); font-style: italic; }
.hero h1 .scribble svg { position: absolute; left: -2%; bottom: -.12em; width: 104%; height: .32em; overflow: visible; }
.hero h1 .scribble path { stroke: var(--ping); stroke-width: 7; fill: none; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.2s .5s var(--ease) forwards; }
.hero .sub { font-size: 20px; color: var(--ink-2); max-width: 520px; margin: 0 0 34px; }
.hero .btns { display: flex; flex-wrap: wrap; gap: 14px; }

/* animated thread demo */
.thread { position: relative; padding: 18px 0 92px; }
.thread::before { content: ""; position: absolute; inset: 6% -6% 0 8%; background: radial-gradient(closest-side, rgba(99, 102, 241, .22), transparent); filter: blur(10px); z-index: -1; }
.bubble {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 16px 18px;
	box-shadow: 0 18px 40px -18px rgba(22, 19, 31, .28);
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 12px;
	align-items: start;
	font-size: 15px;
}
.bubble + .bubble { margin-top: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }
.av-a { background: linear-gradient(135deg, #f472b6, #f97316); }
.av-b { background: linear-gradient(135deg, var(--brand), var(--sky)); }
.av-r { background: var(--ink); }
.bubble .who { font-weight: 700; font-size: 14px; }
.bubble .who span { font-weight: 400; color: var(--muted); }
.bubble p { margin: 2px 0 0; color: var(--ink-2); line-height: 1.5; }
.bubble.reply { margin-left: 44px; position: relative; }
.bubble.reply::before { content: ""; position: absolute; left: -26px; top: -14px; width: 18px; height: 40px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 12px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.toast {
	position: absolute;
	right: -8px;
	bottom: 0;
	width: min(310px, 88%);
	background: var(--ink);
	color: var(--paper);
	border-radius: 18px;
	padding: 14px 16px 14px 56px;
	box-shadow: 0 24px 50px -16px rgba(20, 17, 42, .6);
	font-size: 14px;
	line-height: 1.4;
}
.toast b { display: block; font-size: 14px; }
.toast span { color: #b9b4d6; }
.toast .ping { position: absolute; left: 18px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--ping); }
.toast .ping::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--ping); animation: ripple 1.8s var(--ease) infinite; }

/* thread loop: reply types, posts, then the email pings */
.reply .stack { display: grid; }
.reply .stack > * { grid-area: 1 / 1; }
.reply .typing { align-self: start; opacity: 0; }
.js .thread .reply .typing { animation: show-typing 9s infinite; }
.js .thread .reply .text { animation: show-text 9s infinite; }
.js .thread .toast { animation: toast 9s infinite; }
@keyframes show-typing { 0%, 8% { opacity: 0; } 11%, 29% { opacity: 1; } 32%, 100% { opacity: 0; } }
@keyframes show-text { 0%, 31% { opacity: 0; transform: translateY(6px); } 36%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes toast { 0%, 42% { opacity: 0; transform: translateY(18px) scale(.96); } 48%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); } }

/* ---------- Sections ---------- */
section { padding: 104px 0; }
h2 { font-family: var(--display); font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -1px; margin: 0 0 18px; font-weight: 600; font-variation-settings: "SOFT" 100; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 620px; margin: 0; }

/* ReplyPing intro */
.product-top { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; margin-bottom: 52px; }
.product-name { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.product-name img { width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 10px 24px -10px rgba(67, 56, 202, .6); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; overflow: hidden; }

.step h3 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.3px; margin: 64px 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 16px; }
.step .glyph { position: absolute; left: 26px; top: 24px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--paper-2); color: var(--brand); }

/* bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -24px rgba(22, 19, 31, .35); }
.tile h3 { font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: -.2px; margin: 0 0 6px; }
.tile p { margin: 0; color: var(--ink-2); font-size: 16px; }
.tile.shot { grid-column: span 7; grid-row: span 2; padding: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--paper-2); }
.tile.shot .frame { padding: 26px 26px 0; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.tile.shot img { border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px -20px rgba(22, 19, 31, .4); max-height: 420px; width: auto; object-fit: cover; object-position: top; }
.tile.shot .cap { padding: 18px 26px; background: var(--card); border-top: 1px solid var(--line); }
.tile.w5 { grid-column: span 5; }
.tile.w4 { grid-column: span 4; }
.tile.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tile.dark p { color: #c9c4dc; }
.tile.ping { background: var(--ping-soft); border-color: #fed7aa; }
.big-num { font-family: var(--display); font-size: 80px; line-height: 1; font-weight: 600; font-style: italic; letter-spacing: -2px; margin-bottom: 8px; color: #fdba74; }
.tile .glyph { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--brand); margin-bottom: 18px; }
.tile.dark .glyph { background: rgba(255, 255, 255, .1); color: #fff; }
.tile .email-shot { margin-top: 18px; border-radius: 12px; border: 1px solid var(--line); }
.product-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.product-cta .note { color: var(--muted); font-size: 15px; }

/* ---------- Pro (night) ---------- */
.pro { background: var(--night); color: #ece9f8; position: relative; overflow: hidden; border-radius: 40px 40px 0 0; }
.pro::before, .pro::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: 0; animation: float 14s ease-in-out infinite alternate; }
.pro::before { width: 460px; height: 460px; background: var(--brand); top: -160px; right: -100px; }
.pro::after { width: 360px; height: 360px; background: #c2410c; bottom: -180px; left: -120px; opacity: .35; animation-delay: -6s; }
.pro .wrap { position: relative; z-index: 1; }
.pro h2 { color: #fff; }
.pro .lead { color: #c9c4dc; }
.stamp { display: inline-block; font-family: var(--body); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--ping); border: 2px solid var(--ping); border-radius: 8px; padding: 4px 10px; transform: rotate(-4deg); margin-left: 14px; vertical-align: middle; }
.pro-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 48px; }
.pro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 56px; }
.pcard { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); padding: 24px; transition: background .3s, transform .35s var(--ease), border-color .3s; }
.pcard:hover { background: rgba(255, 255, 255, .09); border-color: rgba(253, 186, 116, .5); transform: translateY(-4px); }
.pcard h3 { font-family: var(--display); font-size: 23px; font-weight: 600; margin: 0 0 8px; color: #fff; letter-spacing: -.2px; line-height: 1.15; }
.pcard p { margin: 0; color: #b9b4d6; font-size: 15px; }

/* waitlist as a reply box */
.replybox { background: var(--card); color: var(--ink); border-radius: 26px; padding: 26px; max-width: 760px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.replybox-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.replybox-top .who { font-weight: 700; font-size: 15px; }
.replybox-top .who span { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.replybox .quote { border-left: 3px solid var(--ping); padding: 4px 0 4px 14px; color: var(--ink-2); margin: 0 0 18px; font-size: 16px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row input[type="email"] { flex: 1 1 260px; padding: 15px 16px; border: 2px solid var(--line); border-radius: 14px; font-size: 16px; font-family: var(--body); background: #fff; color: var(--ink); transition: border-color .2s; }
.form-row input[type="email"]:focus { outline: none; border-color: var(--brand); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 14px; }
.consent input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; }
.form-msg { margin-top: 12px; font-size: 15px; font-weight: 600; min-height: 1px; }
.form-msg.ok { color: #047857; }
.form-msg.err { color: #b91c1c; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- About as an author comment ---------- */
.about { padding-top: 104px; }
.author { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: start; }
.author-card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 32px; position: relative; }
.author-card::after { content: ""; position: absolute; left: 44px; bottom: -14px; width: 26px; height: 26px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.author-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.author-meta .avatar { width: 52px; height: 52px; font-size: 18px; }
.author-meta .who { font-weight: 700; }
.author-meta .tag { font-family: var(--body); font-weight: 700; letter-spacing: .06em; font-size: 11px; background: var(--ink); color: var(--paper); padding: 3px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.author-meta .when { color: var(--muted); font-size: 14px; display: block; }
.author-card p { font-size: 19px; color: var(--ink-2); margin: 0; }
.author-card p + p { margin-top: 14px; }
.links { display: grid; gap: 12px; }
.link-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: transform .3s var(--ease), border-color .3s; }
.link-card:hover { transform: translateX(6px); border-color: var(--brand); }
.link-card small { display: block; color: var(--muted); font-size: 14px; }
.link-card b { font-weight: 600; }
.link-card .arrow { font-size: 22px; color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 40px; }
.foot-big { font-family: var(--display); font-weight: 600; font-style: italic; font-size: clamp(56px, 13vw, 180px); letter-spacing: -.05em; line-height: .85; color: var(--ink); opacity: .07; user-select: none; margin-bottom: 18px; white-space: nowrap; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding-top: 22px; }
.foot-row a { color: var(--muted); }

/* ---------- Legal pages ---------- */
.legal { padding: 64px 0 88px; }
.legal .wrap { max-width: 780px; }
.legal h1 { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 6vw, 64px); letter-spacing: -1px; line-height: 1.05; margin: 0 0 12px; }
.legal h2 { font-size: 28px; letter-spacing: -.3px; margin: 44px 0 10px; }
.legal p, .legal li { color: var(--ink-2); }
.legal li { margin-bottom: 6px; }
.legal .updated { color: var(--muted); margin-bottom: 34px; }
.legal .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes ripple { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blink { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes float { to { transform: translate(-40px, 40px) scale(1.1); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.hero .wrap, .pro-head, .author, .product-top { grid-template-columns: 1fr; }
	.hero .wrap { gap: 40px; }
	.thread { max-width: 520px; }
	.pro-grid { grid-template-columns: repeat(2, 1fr); }
	.steps { grid-template-columns: 1fr; }
	.tile.shot, .tile.w5, .tile.w4 { grid-column: span 12; }
	.tile.shot { grid-row: auto; }
	section { padding: 80px 0; }
}
@media (max-width: 560px) {
	body { font-size: 16px; }
	.nav a.hide-sm { display: none; }
	.nav { gap: 2px; }
	.nav a { padding: 8px 10px; font-size: 14px; }
	.logo { font-size: 22px; }
	.hero { padding-top: 36px; }
	.hero .sub { font-size: 18px; }
	.hero h1 { letter-spacing: -1.5px; }
	.btn { width: 100%; justify-content: center; }
	.pro-grid { grid-template-columns: 1fr; }
	.bubble.reply { margin-left: 22px; }
	.toast { position: relative; right: auto; margin: 16px 0 0 auto; }
	.thread { padding-bottom: 0; }
	.pro { border-radius: 28px 28px 0 0; }
	.form-row button { width: 100%; }
	.author-card { padding: 24px; }
	.author-card p { font-size: 17px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.js .reveal { opacity: 1; transform: none; }
	.hero h1 .scribble path { stroke-dashoffset: 0; }
	.js .thread .reply .typing { opacity: 0; }
	.js .thread .reply .text, .js .thread .toast { opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
}
