/* Personal-site theme: the ctsg-htx.com palette and type (ink, copper,
   Inter Tight headings), dark by default so it reads as its own place rather
   than a copy of the business site. Used by index.html and professional.html.
   portfolio.html and the game stubs stay on styles.css on purpose. */

:root {
    --bg: #0d1520;
    --bg-2: #16212f;
    --bg-3: #1c2939;
    --line: #243142;
    --line-2: #34465c;
    --ink: #ffffff;
    --ink-2: #c3cad4;
    --ink-3: #8d9aab;
    --accent: #b4532a;
    --accent-2: #d4703f;
    --accent-soft: #ffd9c4;
    --radius: 14px;
    --max: 1160px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 16.5px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    /* A long unbroken token (URL, email) must wrap rather than widen the page. */
    overflow-wrap: break-word;
}

h1, h2, h3, h4 {
    font-family: "Inter Tight", Inter, sans-serif;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.02em;
    margin: 0;
}

p { margin: 0 0 1em; }
a { color: var(--accent-2); }
img, video { max-width: 100%; }

/* The hidden attribute has to beat any display rule further down, or scripts
   that hide a finished form get ignored. */
[hidden] { display: none !important; }

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 28px;
}

.label {
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: 14px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- header ---------- */
.top {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(13, 21, 32, .82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.top .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

/* The mark is solid black on transparent; inverted it reads white on ink. */
.brand img {
    height: 36px;
    width: auto;
    display: block;
    filter: invert(1);
}

.brand span {
    font-family: "Inter Tight", Inter, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
    font-weight: 500;
}

.nav a,
.nav-contact-toggle {
    color: var(--ink-2);
    text-decoration: none;
    transition: color .2s;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav-contact-toggle:hover,
.nav-contact-toggle[aria-expanded="true"] {
    color: var(--ink);
}

.nav a.btn-sm {
    color: #fff;
    background: var(--accent);
    padding: 9px 16px;
    border-radius: 999px;
    transition: background .2s;
}

.nav a.btn-sm:hover { background: var(--accent-2); }

/* Contact popover: name + email capture on every page (nav-contact.js). */
.nav-contact-item { position: relative; }

.nav-contact-toggle {
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.nav-contact-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: min(280px, calc(100vw - 2.5rem));
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
    z-index: 200;
}

.nav-contact-panel p.hint {
    font-size: 13.5px;
    color: var(--ink-3);
    margin: 0 0 10px;
}

.nav-contact-panel form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-contact-panel .btn {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 14px;
}

.nav-contact-status:empty { display: none; }
.nav-contact-status { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); }
.nav-contact-status.is-ok { color: var(--accent-soft); font-weight: 600; }
.nav-contact-status.is-error { color: #ff9b8a; }

/* ---------- form fields ---------- */
input,
textarea {
    font: 400 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: #fff;
}

input::placeholder,
textarea::placeholder { color: #6f7c8e; }

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-2);
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: 600 15.5px/1 Inter, sans-serif;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    padding: 15px 24px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    transition: background .2s, transform .2s var(--ease);
}

.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

.btn.ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-2);
}

.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }

/* Marks a link that leaves this site, so it is not a surprise. */
.ext::after {
    content: "\2197";
    font-weight: 600;
    margin-left: .25em;
}

/* ---------- sections ---------- */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }

.sec-head { max-width: 720px; margin-bottom: 32px; }
.sec-head h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 10px; }
.sec-head p { color: var(--ink-2); font-size: 17px; margin: 0; }

/* ---------- footer ---------- */
footer {
    border-top: 1px solid var(--line);
    color: #6f7c8e;
    padding: 28px 0;
    font-size: 14px;
}

.foot {
    display: flex;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
}

.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { color: #fff; }

/* ---------- entrance ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.rise { animation: rise .7s var(--ease) both; }
.rise.d1 { animation-delay: .08s; }
.rise.d2 { animation-delay: .16s; }
.rise.d3 { animation-delay: .24s; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .nav .hide-sm { display: none; }
}

@media (max-width: 720px) {
    section { padding: 52px 0; }
    .wrap { padding: 0 20px; }
    .top .wrap { min-height: 60px; gap: 14px; }
    .brand span { display: none; }
    .nav { gap: 18px; }
}

@media (max-width: 420px) {
    .nav { gap: 14px; font-size: 14px; }
    .nav a.btn-sm { padding: 8px 12px; }
}

/* ---------- fall theme ----------
   On from Oct 1 to Nov 30: the inline script in each page's <head> adds
   html.fall by date (?season=fall or ?season=off to preview any day). Out of
   season none of this matches. The drifting leaves come from fall.js. Pumpkin
   accents keep white button text above 4.5:1. */
html.fall {
    --accent: #b8501a;
    --accent-2: #ec8a2f;
    --accent-soft: #ffe1b3;
}

/* A warm glow at the top right and an ember one low on the left. */
html.fall .stage {
    background:
        radial-gradient(900px 480px at 80% -10%, rgba(236, 138, 47, .2), transparent 70%),
        radial-gradient(700px 420px at -5% 110%, rgba(143, 58, 28, .2), transparent 70%),
        var(--bg);
}

html.fall .play-button { background: rgba(184, 80, 26, .94); }

/* A lit jack-o'-lantern beside the logo and name (just the logo on phones). */
html.fall .brand::after {
    content: "";
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    transform: rotate(-8deg);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='7.6' cy='14.6' rx='5.6' ry='7.4' fill='%23b4532a'/%3E%3Cellipse cx='16.4' cy='14.6' rx='5.6' ry='7.4' fill='%23b4532a'/%3E%3Cellipse cx='12' cy='14.6' rx='5' ry='7.9' fill='%23e07a2a'/%3E%3Cpath d='M12 7.2c-.1-2 .4-3.6 1.8-4.8' stroke='%234d6b2a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3Cpath d='M13.4 5.6c.9-2.3 3.4-3.2 5.8-2.4-.8 2.3-3.3 3.3-5.8 2.4z' fill='%236f8f35'/%3E%3Cpath d='M6.6 13.2 8.6 10l1.8 3.2zM13.6 13.2 15.4 10l2 3.2zM11 15.6l1-1.6 1 1.6zM5.8 16.4l1.8.8 1-.8 1.2 1.2 1.2-.8 1 1.2 1-1.2 1.2.8 1.2-1.2 1 .8 1.8-.8c-.8 3.2-3.4 4.6-6.2 4.6s-5.4-1.4-6.2-4.6z' fill='%23ffd75a' stroke='%237a2e0e' stroke-width='.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* A small leaf in front of the hero and page labels. */
html.fall .label::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l1.6 4.4 2.5-1.2-.5 4.9 3.8-2.6.1 3.1 3.5.6-2.6 3.1 1.3 1.9-4.8.2.4 2.4-4.2-1.9-.5 3.6h-1.2l-.5-3.6-4.2 1.9.4-2.4-4.8-.2 1.3-1.9L1 10.2l3.5-.6.1-3.1 3.8 2.6-.5-4.9 2.5 1.2z'/%3E%3Cpath d='M11.4 18h1.2v5h-1.2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l1.6 4.4 2.5-1.2-.5 4.9 3.8-2.6.1 3.1 3.5.6-2.6 3.1 1.3 1.9-4.8.2.4 2.4-4.2-1.9-.5 3.6h-1.2l-.5-3.6-4.2 1.9.4-2.4-4.8-.2 1.3-1.9L1 10.2l3.5-.6.1-3.1 3.8 2.6-.5-4.9 2.5 1.2z'/%3E%3Cpath d='M11.4 18h1.2v5h-1.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rise { animation: none; }
    .btn, .btn:hover { transition: none; transform: none; }
}
