/* Dharma Labs: editorial serif + mono labels, cream/brown palette with rust accent */
:root {
  --bg: #F3ECE3; --bg-2: #EDE4D8; --card: rgba(251, 246, 240, .72);
  --ink: #2A1A10; --muted: #6B5446; --line: #DCCDBE; --field: #B9A595;
  --fill: #331C10; --onfill: #F4E9E3;
  --brand: #FE710C;        /* exact logo orange: dots, lines, decoration */
  --rust: #D95A06;         /* large accent text (headlines), 3:1+ on cream */
  --rust-strong: #B84C05;  /* small accent text, 4.5:1 on cream */
  --ok: #2F6B34; --warn: #8A6100;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17100B; --bg-2: #1F160F; --card: rgba(36, 25, 17, .72);
    --ink: #F4E9E3; --muted: #C9B4A6; --line: #3A2A1F; --field: #5E4636;
    --fill: #F4E9E3; --onfill: #1A110B; --rust: #FE710C; --brand: #FE710C; --rust-strong: #FE8A3A; --ok: #9BD39F; --warn: #F0CC6E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17100B; --bg-2: #1F160F; --card: rgba(36, 25, 17, .72);
  --ink: #F4E9E3; --muted: #C9B4A6; --line: #3A2A1F; --field: #5E4636;
  --fill: #F4E9E3; --onfill: #1A110B; --rust: #FE710C; --brand: #FE710C; --rust-strong: #FE8A3A; --ok: #9BD39F; --warn: #F0CC6E;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.65;
  -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
main, .nav, .footer { position: relative; z-index: 1; }

#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Type */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; line-height: 1.05; }
h1 { font-size: clamp(2.8rem, 6.2vw, 4.6rem); margin: 26px 0 26px; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin: 10px 0 18px; }
h1 em, h2 em { font-style: italic; color: var(--rust); }
h3 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; line-height: 1.15; margin-bottom: 6px; }
.mono-label { font-family: var(--mono); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.body-lg { font-size: 1.08rem; color: var(--muted); max-width: 600px; margin-bottom: 16px; }
.narrow { max-width: 620px; }
p { color: var(--muted); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-links { display: flex; gap: 30px; font-size: .95rem; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 420px) { .logo-img { height: 32px; } }

/* Buttons */
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-weight: 500;
  font-size: .98rem; text-decoration: none; border: 1px solid var(--fill); transition: transform .15s, background .2s, color .2s; white-space: nowrap; }
.pill:hover { transform: translateY(-2px); }
.pill-primary { background: var(--fill); color: var(--onfill); }
.pill-ghost { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); border-color: var(--line); }
.pill-ghost:hover { border-color: var(--ink); }
.nav .pill { padding: 10px 20px; font-size: .92rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: border-color .15s; }
.icon-btn:hover { border-color: var(--ink); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn .ic-sun { display: none; }
:root[data-theme="dark"] .icon-btn .ic-sun { display: block; }
:root[data-theme="dark"] .icon-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .ic-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .ic-moon { display: none; }
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
  animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 5%, transparent); } }

/* Hero */
.hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 64px; padding-top: 90px; padding-bottom: 110px; align-items: start; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; } }
.intro { display: flex; align-items: center; gap: 18px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line); flex: none; }
.hello { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); line-height: 1.1; margin-bottom: 4px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.stats { padding-top: 10px; }
.stat { padding: 26px 0; border-bottom: 1px solid var(--line); }
.stat:first-child { padding-top: 0; }
.stat:last-child { border-bottom: 0; }
.stat-big { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3rem); color: var(--ink); line-height: 1.1; margin: 10px 0 4px; }
.stat-sub { color: var(--ink); font-size: .98rem; }

/* Socials */
.socials-icons { display: flex; gap: 10px; margin-top: 26px; }
.socials-icons a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line);
  color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); transition: background .2s, color .2s, border-color .2s, transform .15s; }
.socials-icons a:hover { background: var(--fill); color: var(--onfill); border-color: var(--fill); transform: translateY(-2px); }
.socials-icons.lg { justify-content: center; gap: 14px; margin-top: 30px; }
.socials-icons.lg a { width: 54px; height: 54px; }
.socials-icons.lg .ic { width: 22px; height: 22px; }

/* Sections */
.section { padding-top: 96px; padding-bottom: 96px; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 20px; } }
.prose p { font-size: 1.08rem; margin-bottom: 16px; }
.prose blockquote { font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; color: var(--rust);
  border-left: 2px solid var(--brand); padding-left: 20px; margin: 26px 0; }
.center { text-align: center; }
.center .narrow { margin-left: auto; margin-right: auto; }

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 28px; margin: 40px 0 10px; }
.steps li { border-top: 1px solid var(--ink); padding: 18px 0 24px; }
.steps h3 { margin-top: 10px; }
.steps p { font-size: .98rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 40px; }
.card { background: var(--card); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--ink); transform: translateY(-3px); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.card p { font-size: .97rem; }
.status { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.status.live { color: var(--ok); }
.status.beta { color: var(--warn); }
.status.wip { color: var(--rust-strong); }
.card-links { margin-top: auto; padding-top: 20px; display: flex; gap: 18px; font-weight: 500; font-size: .93rem; }
.card-links a { text-decoration: none; border-bottom: 1px solid var(--line); }
.card-links a:hover { border-color: var(--ink); }

/* Log */
.log { list-style: none; margin-top: 36px; border-top: 1px solid var(--line); }
.log li { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: center; }
.log a { font-family: var(--serif); font-size: 1.45rem; text-decoration: none; color: var(--ink); }
.log a:hover { color: var(--rust); }
.log .arrow { color: var(--muted); transition: transform .2s, color .2s; }
.log li:hover .arrow { transform: translateX(4px); color: var(--rust); }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr auto; } .log time { grid-column: 1 / -1; } }

/* Feed strip */
.marquee { overflow: hidden; margin-top: 36px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-inner { display: flex; gap: 16px; width: max-content; animation: mq 45s linear infinite; }
.marquee:hover .marquee-inner, .marquee:focus-within .marquee-inner { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(calc(-50% - 8px)); } }
.marquee .post { flex: 0 0 300px; height: 220px; background: var(--card); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .2s; }
.post header { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.post p { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; color: var(--ink); flex: 1; }
.post footer { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.marquee .tile { flex: 0 0 220px; height: 220px; border: 1px solid var(--line); border-radius: 18px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 6px; padding: 16px;
  text-decoration: none; background-size: cover; background-position: center; background-color: #4A2C1C; transition: border-color .2s; }
.marquee .post:hover, .marquee .tile:hover { border-color: var(--ink); }
.tile:not([style]) { background-image: linear-gradient(135deg, #4A2C1C, #2A1A10); }
.tile.t2 { background-image: linear-gradient(135deg, #B9A08C, #8A6E5A); }
.tile.t3 { background-image: radial-gradient(circle at 30% 30%, #D95A06, #331C10); }
.tile span { font-family: var(--serif); font-size: 1.4rem; font-style: italic; color: #F4E9E3; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.tile small { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: #F4E9E3; opacity: .85; }
.tile .badge { position: absolute; top: 14px; right: 14px; color: #F4E9E3; }
.feed-follow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.feed-follow .pill { padding: 10px 18px; font-size: .9rem; }

/* Footer */
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 30px; padding-bottom: 44px; border-top: 1px solid var(--line); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee { overflow-x: auto; } .marquee-inner { animation: none; }
  .live-dot { animation: none; } html { scroll-behavior: auto; }
}

/* TEJ agent */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tej { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .tej { grid-template-columns: 1fr; gap: 28px; } }
.tej-notes { list-style: none; margin-top: 8px; border-top: 1px solid var(--line); }
.tej-notes li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); position: relative; font-size: .93rem; color: var(--muted); }
.tej-notes li::before { content: "—"; position: absolute; left: 0; color: var(--brand); }
.tej-notes a { color: var(--ink); }
.tej-panel { background: var(--card); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column;
  height: 540px; overflow: hidden; box-shadow: 0 20px 60px -30px rgba(42, 26, 16, .35); }
.tej-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tej-head .mono-label { display: inline-flex; align-items: center; gap: 10px; }
.tej-reset { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font: 500 .78rem var(--sans); color: var(--muted); cursor: pointer; }
.tej-reset:hover { color: var(--ink); border-color: var(--ink); }
.tej-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 11px 15px; border-radius: 16px; font-size: .96rem; line-height: 1.55; overflow-wrap: anywhere; }
.msg p { color: inherit; }
.msg p + p { margin-top: 8px; }
.msg a { color: var(--rust-strong); }
.msg.bot { align-self: flex-start; background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--fill); color: var(--onfill); border-bottom-right-radius: 4px; }
.msg.note { font-size: .88rem; color: var(--muted); border-style: dashed; }
.msg.typing { display: flex; gap: 5px; padding: 14px 16px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .2s; } .msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.tej-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.tej-chips[hidden] { display: none; }
.tej-chips button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font: .84rem var(--sans); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.tej-chips button:hover { border-color: var(--ink); background: color-mix(in srgb, var(--bg) 60%, transparent); }
.tej-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); }
.tej-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; font: .96rem/1.45 var(--sans);
  background: var(--bg); color: var(--ink); max-height: 140px; }
.tej-form textarea:focus { outline: none; border-color: var(--ink); }
.tej-send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--fill); color: var(--onfill); font-size: 1.2rem; cursor: pointer; transition: transform .15s, opacity .15s; }
.tej-send:hover { transform: translateY(-2px); }
.tej-form.busy .tej-send { opacity: .4; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .msg.typing span { animation: none; opacity: .6; } }

/* Brand logo: dark mark on light theme, ivory mark on dark theme */
.logo-img { height: 44px; width: auto; display: block; }
.logo-img.sm { height: 30px; }
.logo-img.on-dark { display: none; }
:root[data-theme="dark"] .logo-img.on-light { display: none; }
:root[data-theme="dark"] .logo-img.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img.on-light { display: none; }
  :root:not([data-theme="light"]) .logo-img.on-dark { display: block; }
}

/* Contact / enquiry form */
.contact { align-items: start; }
.services { list-style: none; margin-top: 28px; }
.services li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; padding: 16px 0; border-top: 1px solid var(--line); }
.services li span { padding-top: 6px; color: var(--rust-strong); }
.services h3 { font-size: 1.3rem; margin-bottom: 2px; }
.services p { font-size: .95rem; }
.enquiry { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.enquiry:hover { transform: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
  font: .96rem/1.45 var(--sans); color: var(--ink); background: color-mix(in srgb, var(--bg) 80%, transparent); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field .invalid, .field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-color: var(--rust-strong); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enquiry-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 4px; }
.enquiry-foot .pill { border: 0; cursor: pointer; font: inherit; font-weight: 500; }
.enquiry.busy .pill { opacity: .5; pointer-events: none; }
.enquiry-status { font-size: .93rem; }
.enquiry-status.ok { color: var(--ok); }
.enquiry-status.err { color: var(--rust-strong); }
