/* ============================================================
   Tucano site styles
   ============================================================ */

/* ---------- Design tokens ----------
   Colours are split into semantic tokens so the whole site can be
   re-skinned by swapping a handful of values. The default (:root)
   theme is "orange"; [data-theme="..."] blocks below override it. */
:root {
  /* Surfaces & text (light themes share these) */
  --heading:     #14171C;
  --ink:         #20252D;   /* body text */
  --muted:       #5E6772;
  --bg:          #FFFFFF;
  --bg-alt:      #FBF7F1;   /* warm cream */
  --surface:     #FFFFFF;   /* cards */
  --border:      #ECE6DC;
  --white:       #FFFFFF;
  --header-bg:   rgba(255, 255, 255, .85);
  --nav-panel:   #FFFFFF;

  /* Dark bands (project tops, contact, footer) — charcoal, the bird's body */
  --dark-1:      #14171C;
  --dark-2:      #1E232B;
  --dark-3:      #2B323C;
  --on-dark:       #CBC3B8;
  --on-dark-soft:  #A89E90;
  --on-dark-faint: #8F857A;

  /* Accent (the beak) */
  --accent:      #F0760C;   /* primary: buttons, borders */
  --accent-deep: #C95808;   /* button hover */
  --link:        #C95808;   /* link text on light bg */
  --link-hover:  #14171C;

  /* Glows & tints */
  --glow-hero:    rgba(240, 118, 12, .12);
  --glow-card:    rgba(240, 118, 12, .50);
  --glow-card-2:  rgba(247, 165, 22, .48);
  --glow-contact: rgba(240, 118, 12, .22);
  --btn-shadow:   rgba(240, 118, 12, .30);
  --platform-label: #F7C98A;

  --radius:      14px;
  --shadow:      0 1px 2px rgba(20, 23, 28, .06), 0 10px 30px rgba(20, 23, 28, .08);
  --shadow-lg:   0 20px 50px rgba(20, 23, 28, .16);
  --maxw:        1080px;

  --font-head:   "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:   "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ===== Theme: Leaf green ===== */
[data-theme="green"] {
  --accent:      #4E9A2E;
  --accent-deep: #3C7A22;
  --link:        #3C7A22;
  --bg-alt:      #F5F8F2;
  --border:      #E4ECDD;
  --glow-hero:    rgba(78, 154, 46, .13);
  --glow-card:    rgba(78, 154, 46, .50);
  --glow-card-2:  rgba(122, 178, 62, .48);
  --glow-contact: rgba(78, 154, 46, .22);
  --btn-shadow:   rgba(78, 154, 46, .28);
  --platform-label: #C2E0A8;
}

/* ===== Theme: Slate blue ===== */
[data-theme="slate"] {
  --accent:      #3E7CA6;
  --accent-deep: #2F6388;
  --link:        #2F6388;
  --bg-alt:      #F3F6F9;
  --border:      #E1E8EF;
  --glow-hero:    rgba(62, 124, 166, .13);
  --glow-card:    rgba(62, 124, 166, .52);
  --glow-card-2:  rgba(91, 151, 192, .48);
  --glow-contact: rgba(62, 124, 166, .22);
  --btn-shadow:   rgba(62, 124, 166, .28);
  --platform-label: #AFD3E8;
}

/* ===== Theme: Mono charcoal (logo-forward, one small pop) ===== */
[data-theme="mono"] {
  --accent:      #20252D;   /* buttons in ink */
  --accent-deep: #14171C;
  --link:        #C95808;   /* the single colour pop */
  --bg-alt:      #F5F5F4;
  --border:      #E6E5E2;
  --glow-hero:    rgba(20, 23, 28, .05);
  --glow-card:    rgba(255, 255, 255, .07);
  --glow-card-2:  rgba(255, 255, 255, .05);
  --glow-contact: rgba(255, 255, 255, .05);
  --btn-shadow:   rgba(20, 23, 28, .22);
  --platform-label: #C9C9C7;
}

/* ===== Theme: Warm dark ===== */
[data-theme="dark"] {
  --heading:     #F4F1EC;
  --ink:         #D8D2C8;
  --muted:       #9A9388;
  --bg:          #14171C;
  --bg-alt:      #1A1E25;
  --surface:     #1E232B;
  --border:      #2C333C;
  --header-bg:   rgba(20, 23, 28, .85);
  --nav-panel:   #1A1E25;

  --dark-1:      #14171C;
  --dark-2:      #20252E;
  --dark-3:      #2B323C;
  --on-dark:       #CBC3B8;
  --on-dark-soft:  #A89E90;
  --on-dark-faint: #8F857A;

  --accent:      #F0760C;
  --accent-deep: #FF8A2A;
  --link:        #F7A516;
  --link-hover:  #FFC368;

  --glow-hero:    rgba(240, 118, 12, .16);
  --glow-card:    rgba(240, 118, 12, .55);
  --glow-card-2:  rgba(247, 165, 22, .50);
  --glow-contact: rgba(240, 118, 12, .26);
  --btn-shadow:   rgba(240, 118, 12, .35);
  --platform-label: #F7C98A;

  --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg:   0 20px 50px rgba(0, 0, 0, .5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; color: var(--heading); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--dark-1); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.text-link { font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px var(--btn-shadow); }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(20, 23, 28, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.header-right { display: flex; align-items: center; gap: 22px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--ink); font-weight: 500; font-size: .98rem; }
.nav a:hover { color: var(--accent); }

/* ---------- Theme switcher ---------- */
.theme-switch {
  display: inline-flex; align-items: center; gap: 9px;
}
.theme-dot {
  width: 22px; height: 22px; border-radius: 50%;
  padding: 0; border: 2px solid transparent; background: none;
  cursor: pointer; position: relative;
  transition: transform .15s ease;
}
.theme-dot::after {
  content: ""; position: absolute; inset: 1px; border-radius: 50%;
  background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.theme-dot:hover { transform: scale(1.14); }
.theme-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-dot[aria-checked="true"] { border-color: var(--heading); }
.dot-orange { --swatch: #F0760C; }
.dot-green  { --swatch: #4E9A2E; }
.dot-slate  { --swatch: #3E7CA6; }
.dot-mono   { --swatch: linear-gradient(135deg, #1E232B 0 50%, #B7B7B5 50% 100%); }
.dot-dark   { --swatch: linear-gradient(135deg, #14171C 0 50%, #F0760C 50% 100%); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0;
  padding: 8px; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--heading); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--glow-hero), transparent 60%),
    linear-gradient(180deg, var(--bg-alt), var(--bg) 70%);
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding: clamp(52px, 8vw, 96px) 24px;
}
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); font-weight: 700; }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 34ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-art { display: flex; justify-content: center; }
.hero-logo {
  width: min(330px, 78%); height: auto; filter: drop-shadow(0 24px 48px rgba(20, 23, 28, .22));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 92px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 620px; margin: 0 auto clamp(32px, 5vw, 48px); }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.section-sub { color: var(--muted); font-size: 1.1rem; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-top {
  display: flex; align-items: baseline; gap: 12px; min-height: 132px; padding: 26px 28px;
  color: #fff;
  background:
    radial-gradient(420px 220px at 25% 15%, var(--glow-card), transparent 70%),
    linear-gradient(145deg, var(--dark-2) 0%, var(--dark-1) 100%);
}
.project-top-alt {
  background:
    radial-gradient(420px 220px at 75% 15%, var(--glow-card-2), transparent 70%),
    linear-gradient(145deg, var(--dark-3) 0%, var(--dark-2) 100%);
}
.project-badge { font-family: var(--font-head); font-weight: 700; font-size: 2.2rem; letter-spacing: -.02em; }
.project-platform { font-family: var(--font-head); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; color: var(--platform-label); opacity: .9; }
.project-body { padding: 26px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.4rem; }
.project-body > p { color: var(--muted); }
.project-foot {
  margin-top: auto; padding-top: 16px; display: flex; align-items: baseline;
  justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
}
.project-meta {
  font-family: var(--font-head); font-size: .82rem;
  letter-spacing: .04em; color: var(--muted); margin: 0;
}
.project-link {
  font-family: var(--font-head); font-weight: 600; font-size: .85rem; white-space: nowrap;
}

/* ---------- About / the name ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: start; }
.about-intro h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.about-intro p { font-size: 1.1rem; color: var(--muted); }
.about-name {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow);
}
.about-name h3 { font-size: 1.25rem; }
.about-name p { color: var(--muted); margin-bottom: .8rem; }
.about-name p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.section-contact {
  background:
    radial-gradient(700px 320px at 50% -20%, var(--glow-contact), transparent 65%),
    linear-gradient(160deg, var(--dark-2) 0%, var(--dark-1) 100%);
  color: #fff;
}
.section-contact h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.contact-inner { max-width: 640px; text-align: center; }
.contact-sub { color: var(--on-dark); font-size: 1.12rem; margin-bottom: 2rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark-1); color: var(--on-dark); padding: 48px 0 26px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 36px; }
.footer-brand { display: inline-flex; align-items: center; gap: 12px; }
.footer-brand .brand-logo { background: #fff; border-radius: 8px; padding: 4px; }
.footer-brand .brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; color: #fff; }
.footer-tag { margin: 0; color: var(--on-dark-soft); font-style: italic; }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-bottom p { margin: 0; font-size: .88rem; color: var(--on-dark-faint); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 4px;
    background: var(--nav-panel); border-bottom: 1px solid var(--border); padding: 18px 24px 26px;
    box-shadow: 0 20px 30px rgba(20, 23, 28, .1);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  }
  .nav a { width: 100%; padding: 12px 4px; }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-toggle { display: flex; }
  .header-right { gap: 14px; }

  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { order: -1; }
  .hero-logo { width: min(220px, 56%); }

  .project-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 460px) {
  .theme-dot { width: 19px; height: 19px; }
  .theme-switch { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-logo { animation: none; }
  .btn:hover, .project:hover { transform: none; }
}
