/* =====================================================================
   mmarques.dev — modo mynd
   The house visual language (see MODO_MYND.md in ConnectTheNotes):
   comfy, clean, tactile — a terminal made cozy crossed with the warmth
   of analog paper and scrapbook stickies. One typeface, lowercase copy,
   warm paper ground, things placed by hand, sparse muted color.
   ===================================================================== */

/* ----------------------------- Tokens ----------------------------- */
:root {
  /* paper + ink */
  --paper: #faf6ed;
  --paper-2: #f3ecdd;
  --paper-line: #e9dfca;     /* ruled lines */
  --text-primary: #2c2722;   /* ink */
  --text-secondary: #6f6657;
  --text-muted: #9c9384;

  /* sparse muted accents */
  --accent: #3e6ad4;         /* calm blue (primary) */
  --accent-warm: #c4663c;    /* clay / terracotta   */
  --accent-mint: #3aa37c;
  --pin-red: #d6493a;

  /* surfaces + shape */
  --surface: #f1eadc;
  --surface-hover: #eae1cf;
  --border-soft: rgba(44, 39, 34, 0.10);
  --border-hair: rgba(44, 39, 34, 0.06);
  --radius: 12px;

  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --nav-h: 70px;

  --shadow-card: 0 10px 24px rgba(44, 39, 34, 0.10), 0 2px 6px rgba(44, 39, 34, 0.06);
  --shadow-lift: 0 18px 34px rgba(44, 39, 34, 0.18);

  --spring: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* pastel sticky tones (assorted) */
.tone-0 { --tone-bg: #dce9fb; --tone-bd: #b9d2f2; --tone-ink: #39598a; } /* blue   */
.tone-1 { --tone-bg: #fbdde8; --tone-bd: #f1c1d4; --tone-ink: #9a4d68; } /* pink   */
.tone-2 { --tone-bg: #d9f0e4; --tone-bd: #bde5d1; --tone-ink: #3a7a5c; } /* mint   */
.tone-3 { --tone-bg: #fbf1c9; --tone-bd: #efe2a6; --tone-ink: #7d6a2c; } /* yellow */
.tone-4 { --tone-bg: #e8e0f7; --tone-bd: #d5c8ef; --tone-ink: #5e4e86; } /* lilac  */

/* ------------------------------- Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-mono);
  background: var(--paper);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul { list-style: none; }

::selection { background: #dce9fb; color: var(--text-primary); }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--paper-line); border-radius: 20px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #ddd0b4; }

/* ---------------------- Paper ground (ruled lines) ---------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--paper-line) 0, var(--paper-line) 1.4px,
    transparent 1.4px, transparent 34px
  );
  opacity: 0.5;
}

/* ------------------------------ Utilities ------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* hand-placed tilt (composes with reveal + hover via --tilt) */
.tilt-a { --tilt: -1.3deg; }
.tilt-b { --tilt: 1.1deg; }
.tilt-c { --tilt: -0.7deg; }
.tilt-d { --tilt: 0.9deg; }

/* reveal on scroll — defined before components so their :hover wins */
.reveal { opacity: 0; transform: translateY(18px) rotate(var(--tilt, 0deg)); transition: opacity 0.65s var(--spring), transform 0.65s var(--spring), box-shadow 0.32s var(--spring); }
.reveal.in { opacity: 1; transform: rotate(var(--tilt, 0deg)); }

/* section-to-section "page" transition — plays once as each new
   section is scrolled into view, whether by wheel, trackpad or touch */
.page-in {
  opacity: 0;
  transform: translateY(72px) scale(0.975);
  transition: opacity 0.9s var(--spring), transform 0.9s var(--spring);
  will-change: transform, opacity;
}
.page-in.in { opacity: 1; transform: none; }

section { position: relative; padding-block: clamp(70px, 10vw, 118px); }

/* washi-tape label (section eyebrow) */
.tape {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--tone-ink, var(--text-secondary));
  background: var(--tone-bg, var(--surface));
  border: 1px solid var(--tone-bd, var(--border-soft));
  padding: 0.32em 0.95em;
  border-radius: 3px;
  transform: rotate(-1.2deg);
  box-shadow: 0 2px 5px rgba(44, 39, 34, 0.08);
  position: relative;
}
.tape::before, .tape::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px; height: 60%;
  transform: translateY(-50%);
  background: rgba(44, 39, 34, 0.045);
}
.tape::before { left: -3px; }
.tape::after { right: -3px; }

.section-head { margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 {
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 18px;
}
.section-head p { color: var(--text-secondary); max-width: 56ch; margin-top: 12px; font-size: 0.95rem; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.8em 1.4em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.28s var(--spring), box-shadow 0.28s var(--spring), background 0.24s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 1em; height: 1em; }
.btn-primary { background: var(--accent); color: #fdfcf8; box-shadow: 0 3px 10px rgba(62, 106, 212, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(62, 106, 212, 0.3); }
.btn-ghost { border-color: var(--border-soft); background: #fffefb; color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ------------------------------- Navbar ------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(250, 246, 237, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border-hair);
  box-shadow: 0 6px 18px -14px rgba(44, 39, 34, 0.25);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .glyph { width: 26px; height: 26px; flex: none; }
.brand b { font-weight: 600; font-size: 0.98rem; letter-spacing: 0.01em; }
.brand b span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  font-size: 0.86rem;
  color: var(--text-secondary);
  padding: 0.45em 0.85em;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text-primary); background: var(--surface); }
.nav-links a.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fffefb;
}
.lang-toggle button { padding: 0.42em 0.75em; color: var(--text-muted); transition: color 0.2s, background 0.2s; }
.lang-toggle button.active { background: var(--surface); color: var(--text-primary); }

.nav-burger { display: none; width: 38px; height: 38px; border: 1px solid var(--border-soft); border-radius: 10px; position: relative; background: #fffefb; }
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute;
  width: 15px; height: 1.6px; border-radius: 2px;
  background: var(--text-primary);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--spring), opacity 0.2s;
}
.nav-burger span::before { transform: translate(-50%, -5.5px); }
.nav-burger span::after { transform: translate(-50%, 5.5px); }
.nav-burger.open span { background: transparent; }
.nav-burger.open span::before { transform: translate(-50%, 0) rotate(45deg); }
.nav-burger.open span::after { transform: translate(-50%, 0) rotate(-45deg); }

/* -------------------------------- Hero -------------------------------- */
.hero {
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  text-align: center;
}
.hero .wrap { display: flex; flex-direction: column; align-items: center; }

/* status = a little sticky note */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--tone-ink);
  background: var(--tone-bg);
  border: 1px solid var(--tone-bd);
  padding: 0.5em 1em;
  border-radius: 3px;
  transform: rotate(1.4deg);
  box-shadow: 0 3px 7px rgba(44, 39, 34, 0.1);
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 0 0 rgba(58, 163, 124, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(58, 163, 124, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(58, 163, 124, 0); }
  100% { box-shadow: 0 0 0 0 rgba(58, 163, 124, 0); }
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 4.3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 30px 0 0;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .accent::after { content: "_"; animation: blink 1.15s steps(1) infinite; color: var(--text-muted); font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }

.hero .tagline {
  font-size: clamp(0.95rem, 2.1vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 20px auto 0;
}
.hero .role {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.hero .role::before { content: "// "; }

.hero-cta { display: flex; gap: 13px; flex-wrap: wrap; justify-content: center; margin-top: 36px; }

.scroll-hint {
  margin-top: clamp(44px, 7vw, 80px);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.scroll-hint svg { width: 16px; height: 16px; animation: bob 2s var(--spring) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ------------------------------- Works ------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.chip {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  background: #fffefb;
  padding: 0.45em 0.9em;
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--text-primary); border-color: rgba(44, 39, 34, 0.22); }
.chip.active { color: #fdfcf8; background: var(--accent); border-color: var(--accent); }

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(26px, 3.4vw, 44px);
  padding-top: 8px;
}

/* project card = polaroid pinned to the wall */
.work {
  display: flex;
  flex-direction: column;
  background: #fffefb;
  border-radius: 5px;
  padding: 14px 14px 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.32s var(--spring), box-shadow 0.32s var(--spring);
}
.work:hover { transform: rotate(0deg) translateY(-5px); box-shadow: var(--shadow-lift); z-index: 2; }
.work.is-hidden { display: none; }

.work .pin {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--pin, var(--pin-red));
  box-shadow: 0 2px 4px rgba(44, 39, 34, 0.32), inset -2px -2px 3px rgba(0, 0, 0, 0.18);
  z-index: 3;
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--border-hair);
  background: var(--paper-2);
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.work-thumb .placeholder { width: 100%; height: 100%; display: grid; place-items: center; }
.work-thumb .placeholder .ph-mark { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 500; color: var(--tone-ink); }
.work-thumb .placeholder.toned { background: var(--tone-bg); }
.work-year {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 254, 251, 0.92);
  border: 1px solid var(--border-soft);
  padding: 0.2em 0.6em;
  border-radius: 6px;
}

.work-body { padding: 16px 6px 0; display: flex; flex-direction: column; flex: 1; }
.work-body h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.work-body p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px; flex: 1; }

.work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--tone-ink, var(--text-secondary));
  background: var(--tone-bg, var(--surface));
  border: 1px solid var(--tone-bd, var(--border-soft));
  padding: 0.28em 0.65em;
  border-radius: 4px;
}

.work-link {
  display: inline-flex; align-items: center; gap: 0.5em;
  margin-top: 16px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--accent);
  width: max-content;
  transition: gap 0.25s var(--spring);
}
.work-link svg { width: 0.95em; height: 0.95em; transition: transform 0.25s var(--spring); }
.work-link:hover { gap: 0.85em; }
.work-link:hover svg { transform: translate(2px, -2px); }

/* ------------------------------- About ------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 0.9fr; gap: clamp(30px, 5vw, 64px); align-items: start; }
.about-copy p { color: var(--text-secondary); margin-bottom: 18px; font-size: 0.92rem; }
.about-copy p:first-of-type { color: var(--text-primary); font-size: 0.98rem; }

/* profile card = index card taped to the page */
.about-card {
  --tilt: 1deg;
  background: #fffefb;
  border: 1px solid var(--border-hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--tilt));
  position: relative;
  transition: transform 0.32s var(--spring), box-shadow 0.32s var(--spring);
}
.about-card:hover { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-lift); }
.about-card .card-tape {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 92px; height: 24px;
  background: var(--tone-bg);
  border: 1px solid var(--tone-bd);
  opacity: 0.85;
  border-radius: 2px;
}
.about-card .card-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 18px 12px;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 0.76rem;
  color: var(--text-muted);
}
.about-card .card-bar span { margin-left: auto; }
.about-facts { padding: 4px 0 8px; }
.about-facts li { display: flex; gap: 13px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px dashed var(--border-hair); }
.about-facts li:last-child { border-bottom: none; }
.about-facts svg { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: 3px; }
.about-facts .k { font-size: 0.66rem; letter-spacing: 0.06em; color: var(--text-muted); }
.about-facts .v { font-size: 0.86rem; color: var(--text-primary); }

/* ------------------------------- Skills ------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2.6vw, 30px);
  padding-top: 10px;
}

/* each skill = a post-it */
.skill {
  background: var(--tone-bg);
  border: 1px solid var(--tone-bd);
  color: var(--tone-ink);
  border-radius: 3px;
  padding: 18px 16px 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 14px rgba(44, 39, 34, 0.10);
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--spring);
}
.skill::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 46px; height: 15px;
  background: rgba(255, 254, 251, 0.65);
  border: 1px solid var(--border-hair);
  border-radius: 2px;
}
.skill:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 14px 26px rgba(44, 39, 34, 0.16); z-index: 2; }
.skill.is-hidden { display: none; }

.skill .name { font-size: 0.82rem; font-weight: 500; line-height: 1.35; }
.skill .skill-meta { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.skill .val { font-size: 1.35rem; font-weight: 600; }
.skill .of { font-size: 0.66rem; opacity: 0.65; }

/* ------------------------------ Contact ------------------------------ */
.contact { text-align: center; }
.contact .wrap { display: flex; flex-direction: column; align-items: center; }
.contact h2 {
  font-size: clamp(1.8rem, 4.6vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 20px;
}
.contact h2 .accent { color: var(--accent); }
.contact p { color: var(--text-secondary); max-width: 48ch; margin: 16px auto 0; font-size: 0.92rem; }
.contact .email {
  display: inline-block;
  margin-top: 30px;
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 2px solid var(--paper-line);
  padding-bottom: 4px;
  transition: color 0.25s, border-color 0.25s;
}
.contact .email:hover { color: var(--accent); border-color: var(--accent); }
.socials { display: flex; gap: 11px; margin-top: 34px; }
.socials a {
  width: 45px; height: 45px;
  display: grid; place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fffefb;
  color: var(--text-secondary);
  box-shadow: 0 2px 6px rgba(44, 39, 34, 0.06);
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--spring), background 0.25s;
}
.socials a svg { width: 19px; height: 19px; }
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px) rotate(-2deg); }

/* ------------------------------- Footer ------------------------------- */
.footer { border-top: 1px solid var(--border-hair); padding-block: 42px; background: var(--paper-2); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 28px 60px; justify-content: space-between; align-items: flex-start; }
.footer .f-brand { max-width: 32ch; }
.footer .f-brand p { color: var(--text-secondary); font-size: 0.82rem; margin-top: 12px; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer h4 { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-cols a { display: block; color: var(--text-secondary); font-size: 0.84rem; padding: 4px 0; transition: color 0.2s; }
.footer-cols a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border-hair); background: var(--paper-2); }
.footer-bottom .wrap { padding-top: 20px; padding-bottom: 0; }
.footer-bottom small { font-size: 0.74rem; color: var(--text-muted); }

/* ------------------------------ Mobile nav ------------------------------ */
.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: rgba(250, 246, 237, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 14px 28px -18px rgba(44, 39, 34, 0.3);
  display: none;
  flex-direction: column;
  padding: 14px var(--gutter) 24px;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 0.98rem; color: var(--text-secondary); padding: 14px 0; border-bottom: 1px dashed var(--border-soft); }
.mobile-menu a:last-of-type { border-bottom: none; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 980px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 920px) { .about-grid { grid-template-columns: 1fr; } .about-card { --tilt: 0.6deg; } }
@media (max-width: 760px) {
  .nav-links, .nav-actions .lang-toggle { display: none; }
  .nav-burger { display: block; }
  .works-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { justify-content: center; }
  .footer-cols { gap: 34px; }
}

/* ------------------------- Reduced motion ------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal, .page-in { opacity: 1; transform: none; }
}
