/* ==========================================================================
   Folio - portfolio template
   1 Tokens  2 Base  3 Layout  4 Header  5 Hero  6 Work  7 About
   8 Services  9 Experience  10 Testimonials  11 Contact  12 Footer  13 Motion
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Light theme */
  --bg: #f2f4fa;
  --surface: #ffffff;
  --ink: #0f1220;
  --muted: #474d66;
  --line: #d5d9e8;
  --accent: #2b3fe0;
  --on-accent: #ffffff;
  --mark: #ffd84d;
  --on-mark: #0f1220;
  --shadow: 0 1px 2px rgba(15, 18, 32, .06), 0 12px 32px -12px rgba(43, 63, 224, .25);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 20px;
  --header-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f1c;
  --surface: #161933;
  --ink: #eef0fb;
  --muted: #a9aecb;
  --line: #2a2e50;
  --accent: #9ba9ff;
  --on-accent: #0d0f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.65 var(--font-body);
  overflow-x: hidden; transition: background-color .3s, color .3s;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--mark); color: var(--on-mark); }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 16px;
  background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3. LAYOUT ---------------------------------------------------------------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 150px); }
.section-head { max-width: 40rem; margin-bottom: clamp(36px, 6vw, 72px); }
.section-head h2 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
.section-head p { margin-top: 18px; color: var(--muted); max-width: 34rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 2px solid var(--ink);
  background: transparent; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .2s, background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* 4. HEADER ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.2rem var(--font-display); text-decoration: none; letter-spacing: -.02em; margin-right: auto; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 6px 4px 0 -2px var(--mark); }
.nav-list { display: flex; gap: 6px; }
.nav-list a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; transition: color .2s, background-color .2s; }
.nav-list a:hover, .nav-list a.active { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 24px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s; }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-list { flex-direction: column; }
  .nav-list a { font: 600 1.5rem var(--font-display); padding: 14px 4px; color: var(--ink); border-radius: 8px; }
}

/* 5. HERO ------------------------------------------------------------------ */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(56px, 8vw, 100px); }
.hero h1 {
  font-size: clamp(2.6rem, 8.6vw, 7.4rem); line-height: .98; letter-spacing: -.04em; font-weight: 800;
  max-width: 14ch; text-wrap: balance;
}
/* inline glyph shapes that live inside the headline */
.glyph { display: inline-block; vertical-align: -.06em; height: .78em; margin-inline: .06em; }
.glyph-pill { width: 1.5em; border-radius: 999px; background: linear-gradient(100deg, var(--accent), var(--mark)); }
.glyph-circle { width: .78em; border-radius: 50%; background: var(--mark); box-shadow: inset -.1em -.1em 0 rgba(15,18,32,.12); }
.glyph-tile {
  width: .78em; border-radius: .18em; background: var(--accent);
  background-image: linear-gradient(45deg, transparent 46%, var(--on-accent) 46% 54%, transparent 54%);
  transform: rotate(-6deg);
}
.hero-foot { margin-top: clamp(32px, 5vw, 56px); display: grid; gap: 32px; grid-template-columns: 1fr; align-items: end; }
.hero-lede { max-width: 30rem; color: var(--muted); font-size: 1.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: clamp(48px, 7vw, 88px); padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); }
.hero-meta strong { color: var(--ink); font-weight: 600; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1f9d55; margin-right: 8px; }
@media (min-width: 900px) { .hero-foot { grid-template-columns: 1fr auto; } }

/* 6. WORK ------------------------------------------------------------------ */
.work-grid { display: grid; gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .work-grid { grid-template-columns: 1fr 1fr; }
  .project:nth-child(even) { margin-top: 72px; }   /* staggered columns */
}
.project a { text-decoration: none; display: block; }
.project-cover {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--c1);
  border: 1px solid var(--line); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.project-cover svg { width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project a:hover .project-cover, .project a:focus-visible .project-cover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project a:hover .project-cover svg, .project a:focus-visible .project-cover svg { transform: scale(1.06) rotate(-1deg); }
.project-info { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-top: 18px; }
.project h3 { font-size: 1.5rem; }
.project a:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.project-year { color: var(--muted); font-size: .95rem; flex: none; }
.project-desc { color: var(--muted); margin-top: 6px; max-width: 30rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags li { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; color: var(--muted); background: var(--surface); }

/* 7. ABOUT ----------------------------------------------------------------- */
.about-grid { display: grid; gap: 48px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 5fr 6fr; gap: 88px; } }
.portrait { aspect-ratio: 1 / 1.05; border-radius: 50% 50% var(--radius) var(--radius) / 38% 38% var(--radius) var(--radius); overflow: hidden; background: var(--accent); max-width: 440px; }
.portrait svg { width: 100%; height: 100%; }
.about-text h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 24px; }
.about-text p { color: var(--muted); max-width: 36rem; }
.about-text p + p { margin-top: 16px; }
.skills { margin-top: 40px; display: grid; gap: 22px; }
.skills h3 { font-size: 1.05rem; margin-bottom: 10px; }
.skills .tags { margin-top: 0; }
.skills .tags li { color: var(--ink); }

/* 8. SERVICES -------------------------------------------------------------- */
.services { border-top: 1px solid var(--line); }
.service { display: grid; gap: 10px 40px; padding-block: 34px; border-bottom: 1px solid var(--line); grid-template-columns: 1fr; transition: padding .3s; }
.service h3 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.service p { color: var(--muted); max-width: 32rem; }
.service-price { font-weight: 600; }
.service-price span { color: var(--muted); font-weight: 400; display: block; font-size: .92rem; }
@media (min-width: 820px) {
  .service { grid-template-columns: 5fr 5fr 2fr; align-items: baseline; }
  .service-price { text-align: right; }
  .service:hover { padding-left: 14px; }
}

/* 9. EXPERIENCE (a true sequence: years on a vertical rail) ---------------- */
.timeline { position: relative; display: grid; gap: 44px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.job { position: relative; display: grid; gap: 6px 40px; }
.job::before { content: ""; position: absolute; left: -28px; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.job:first-child::before { background: var(--accent); }
.job-when { color: var(--muted); font-size: .98rem; }
.job h3 { font-size: 1.5rem; }
.job-org { font-weight: 600; }
.job p { color: var(--muted); max-width: 36rem; margin-top: 8px; }
@media (min-width: 820px) {
  .timeline { padding-left: 0; }
  .timeline::before { left: calc(25% - 1px); }
  .job { grid-template-columns: 25% 1fr; }
  .job::before { left: calc(25% - 7px); }
  .job-when { padding-top: 4px; }
  .job-body { padding-left: 40px; }
}

/* 10. TESTIMONIALS --------------------------------------------------------- */
.quotes { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .quotes { grid-template-columns: 1.4fr 1fr; } .quote-main { grid-row: span 2; } }
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.quote blockquote { margin: 0; font: 500 1.2rem/1.5 var(--font-display); letter-spacing: -.01em; }
.quote-main blockquote { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; }
.quote.quote-main { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.quote.quote-main figcaption span { color: inherit; opacity: .9; }
.quote figcaption { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--mark); color: var(--on-mark); display: grid; place-items: center; font: 700 1rem var(--font-display); }
.quote figcaption strong { display: block; line-height: 1.3; }
.quote figcaption span { color: var(--muted); font-size: .94rem; }

/* 11. CONTACT -------------------------------------------------------------- */
.contact-grid { display: grid; gap: 48px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 5fr 6fr; gap: 88px; } }
.contact h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -.035em; }
.contact-copy p { color: var(--muted); margin-top: 20px; max-width: 28rem; }
.contact-mail { display: inline-block; margin-top: 28px; font: 600 clamp(1.2rem, 3vw, 1.6rem) var(--font-display); text-decoration-thickness: 3px; text-decoration-color: var(--mark); text-underline-offset: 6px; overflow-wrap: anywhere; }
.contact-mail:hover { text-decoration-color: var(--accent); }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); display: grid; gap: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.field .error { color: #b3261e; font-size: .92rem; margin-top: 6px; min-height: 0; }
:root[data-theme="dark"] .field .error { color: #ff9a92; }
.field.invalid input, .field.invalid textarea { border-color: #b3261e; }
:root[data-theme="dark"] .field.invalid input, :root[data-theme="dark"] .field.invalid textarea { border-color: #ff9a92; }
.hp { position: absolute; left: -9999px; }
.form-status { display: none; }
.form-success { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 5vw, 48px); }
.form-success[hidden] { display: none; }
.form-success .check { width: 56px; height: 56px; border-radius: 50%; background: var(--mark); display: grid; place-items: center; margin-bottom: 20px; }
.form-success svg { width: 28px; height: 28px; fill: none; stroke: var(--on-mark); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.form-success h3 { font-size: 1.8rem; margin-bottom: 8px; }
.form-success p { color: var(--muted); }
.form-error { color: #b3261e; font-weight: 500; }
:root[data-theme="dark"] .form-error { color: #ff9a92; }

/* 12. FOOTER --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 44px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 32px; justify-content: space-between; align-items: center; }
.social { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.social a { color: var(--ink); font-weight: 500; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.social a:hover { border-bottom-color: var(--accent); }

/* 13. MOTION --------------------------------------------------------------- */
/* One orchestrated moment: the hero headline shapes settle in on load. */
@keyframes settle { from { transform: scale(.2) rotate(-40deg); opacity: 0; } to { opacity: 1; } }
.glyph { animation: settle .8s cubic-bezier(.2,.9,.3,1.2) both; }
.glyph:nth-of-type(2) { animation-delay: .15s; }
.glyph:nth-of-type(3) { animation-delay: .3s; }
/* Scroll reveal only for work covers (JS adds .js-reveal on <html>). */
.js-reveal .project { opacity: 0; transform: translateY(28px); transition: opacity .7s, transform .7s cubic-bezier(.2,.7,.2,1); }
.js-reveal .project.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js-reveal .project { opacity: 1; transform: none; }
}
