/* ============================================================
   Rodrigo Lima — Portfolio
   Design concept: field telemetry / device status readout.
   Color: deep navy ground + signal-cyan accent + amber secondary.
   Type: Outfit (display) / IBM Plex Sans (body) / JetBrains Mono (data).
   ============================================================ */

:root {
  /* ---- light theme (default) ---- */
  --bg: #F5F6F8;
  --bg-elevated: #FFFFFF;
  --bg-sunken: #ECEEF2;
  --text: #12151C;
  --text-muted: #4B5163;
  --text-faint: #7A8094;
  --border: #DBDFE7;
  --border-strong: #C3C9D4;
  --accent: #0C8B87;
  --accent-soft: rgba(12, 139, 135, 0.10);
  --accent-2: #B36A15;
  --accent-2-soft: rgba(179, 106, 21, 0.12);
  --shadow-color: 220 20% 40%;

  --font-display: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0E14;
    --bg-elevated: #12151D;
    --bg-sunken: #080A0F;
    --text: #E9EBF2;
    --text-muted: #9298AB;
    --text-faint: #5C6377;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #3DDBD9;
    --accent-soft: rgba(61, 219, 217, 0.12);
    --accent-2: #FFB454;
    --accent-2-soft: rgba(255, 180, 84, 0.12);
    --shadow-color: 220 60% 2%;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0B0E14;
  --bg-elevated: #12151D;
  --bg-sunken: #080A0F;
  --text: #E9EBF2;
  --text-muted: #9298AB;
  --text-faint: #5C6377;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #3DDBD9;
  --accent-soft: rgba(61, 219, 217, 0.12);
  --accent-2: #FFB454;
  --accent-2-soft: rgba(255, 180, 84, 0.12);
  --shadow-color: 220 60% 2%;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F5F6F8;
  --bg-elevated: #FFFFFF;
  --bg-sunken: #ECEEF2;
  --text: #12151C;
  --text-muted: #4B5163;
  --text-faint: #7A8094;
  --border: #DBDFE7;
  --border-strong: #C3C9D4;
  --accent: #0C8B87;
  --accent-soft: rgba(12, 139, 135, 0.10);
  --accent-2: #B36A15;
  --accent-2-soft: rgba(179, 106, 21, 0.12);
  --shadow-color: 220 20% 40%;
  color-scheme: light;
}

/* ---------------------------------------------------------- */
/* Reset & base                                                */
/* ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
  color: var(--text);
}

p { margin: 0; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------------------------------------------------------- */
/* Layout containers                                           */
/* ---------------------------------------------------------- */

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 24px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 56px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

/* ---------------------------------------------------------- */
/* Header                                                       */
/* ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.logo-bracket { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav a {
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: color .2s ease;
  position: relative;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--text); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn, .lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.icon-btn { width: 36px; }

/* Hover only on fine pointers — sticky :hover on mobile paints both PT/EN accent */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
  .lang-btn:hover { border-color: var(--accent); }
}

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
html.dev-mode .icon-sun { display: none; }
html.dev-mode .icon-moon { display: block; }

.lang-btn {
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  gap: 4px;
  letter-spacing: 0.02em;
}

.lang-pt, .lang-en { transition: color .2s ease; color: var(--text-muted); }
.lang-sep { color: var(--text-faint); }
html[lang="pt-BR"] .lang-pt { color: var(--accent); }
html[lang="en"] .lang-en { color: var(--accent); }

/* ---------------------------------------------------------- */
/* Hero                                                          */
/* ---------------------------------------------------------- */

.hero { padding: 72px 32px 40px; max-width: 1180px; margin: 0 auto; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 18px;
}

.hero-role {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-subtitle {
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

.hero-desc {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---- Device card (status readout) ---- */

.hero-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.device-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 30px 60px -30px hsl(var(--shadow-color) / 0.5);
}

.device-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.device-card-dots { display: flex; gap: 5px; }
.device-card-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-strong); display: block;
}

.avatar-frame {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 22px;
}

.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0.5;
  animation: ring-spin 14s linear infinite;
}
.avatar-ring::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

@keyframes ring-spin { to { transform: rotate(360deg); } }

.avatar-frame img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.telemetry {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.telemetry-row dt { color: var(--text-faint); }
.telemetry-row dd { margin: 0; color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------- */
/* Stats bar                                                    */
/* ---------------------------------------------------------- */

.stats-bar {
  max-width: 1080px;
  margin: 88px auto 0;
  padding: 36px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; gap: 6px; text-align: center; }

.stat-num {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------- */
/* Timeline (experience)                                        */
/* ---------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 28px 0 28px 32px;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 34px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-meta { padding-top: 4px; }
.timeline-date { font-size: 0.82rem; color: var(--text-faint); }

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-title-row h3 { font-size: 1.2rem; }

.timeline-org {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.timeline-body p:not(.timeline-org) {
  color: var(--text-muted);
  max-width: 68ch;
  margin-bottom: 16px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.chip-status {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.chip-status-amber { background: var(--accent-2-soft); color: var(--accent-2); }

/* ---------------------------------------------------------- */
/* Projects                                                     */
/* ---------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 48px -28px hsl(var(--shadow-color) / 0.55);
}

.project-card-top { margin-bottom: 4px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: var(--bg-sunken);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.status-dot-sm { width: 6px; height: 6px; animation: none; box-shadow: none; }
.status-dot-amber { background: var(--accent-2); }

.project-card h3 { font-size: 1.35rem; }

.project-sub {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.project-desc { color: var(--text-muted); }

.project-highlight {
  background: var(--bg-sunken);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 4px 0 6px;
}

.highlight-label {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.project-highlight p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------------------------------------------------------- */
/* Skills                                                        */
/* ---------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 48px;
}

.skill-group h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------- */
/* Education & languages                                         */
/* ---------------------------------------------------------- */

.edu-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.edu-row-langs { grid-template-columns: repeat(3, 1fr); }

.edu-item { display: flex; flex-direction: column; gap: 4px; }

.edu-label {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.edu-inst { color: var(--text-muted); font-size: 0.9rem; }

/* ---------------------------------------------------------- */
/* Contact                                                       */
/* ---------------------------------------------------------- */

.contact-card {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-sunken));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.contact-card h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  max-width: 22ch;
}

.contact-card p { color: var(--text-muted); font-size: 1.05rem; }

.contact-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

/* ---------------------------------------------------------- */
/* Footer                                                         */
/* ---------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 40px 24px 56px;
  color: var(--text-faint);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-joke {
  opacity: 0.75;
  font-size: 0.72rem;
}

/* ---------------------------------------------------------- */
/* Developer Mode — Dart/Flutter IDE theme                       */
/* ---------------------------------------------------------- */

/* Toggle button */
.devmode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.devmode-btn:hover { border-color: var(--accent); color: var(--accent); }
.devmode-braces { color: var(--accent); font-weight: 700; }
.devmode-label-exit { display: none; }

/* Dev theme tokens — always dark, Dart navy + Flutter sky blue.
   Specificity beats :root[data-theme="light"] so light preference cannot leak in. */
html.dev-mode,
html.dev-mode[data-theme="light"],
html.dev-mode[data-theme="dark"] {
  --bg: #0D131E;
  --bg-elevated: #131C2B;
  --bg-sunken: #0A0F17;
  --text: #DFE7F2;
  --text-muted: #8CA1BD;
  --text-faint: #55677F;
  --border: rgba(19, 185, 253, 0.10);
  --border-strong: rgba(19, 185, 253, 0.28);
  --accent: #13B9FD;
  --accent-soft: rgba(19, 185, 253, 0.12);
  --accent-2: #FFB454;
  --accent-2-soft: rgba(255, 180, 84, 0.12);
  --shadow-color: 215 70% 3%;
  color-scheme: dark;
}

html.dev-mode .devmode-btn {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
html.dev-mode .devmode-label-on { display: none; }
html.dev-mode .devmode-label-exit { display: inline; }

/* Theme toggle is meaningless inside the IDE */
html.dev-mode #theme-toggle { opacity: 0.35; pointer-events: none; }

/* Header re-theming */
.logo-dev { display: none; color: var(--text); font-size: 0.9rem; }
.logo-prompt { color: var(--accent); }
html.dev-mode .logo-classic { display: none; }
html.dev-mode .logo-dev { display: inline; }
html.dev-mode .site-nav a::before { content: "./"; color: var(--text-faint); }

/* View switching — the IDE skin lives INSIDE each component, layout stays */
html.dev-mode .footer-joke { display: none; }

.footer-dev { display: none; font-size: 0.72rem; }
html.dev-mode .footer-dev { display: block; }

/* Hero: classic copy vs mini main.dart window, side by side with the photo */
.hero-dev { display: none; margin-bottom: 32px; }
html.dev-mode .hero-classic { display: none; }
html.dev-mode .hero-dev { display: block; }

.hero-editor { max-width: 100%; margin: 0; }
.hero-editor .code { font-size: 0.76rem; padding: 16px 0 18px; }
.hero-editor .code li { padding: 0 18px 0 46px; }
.hero-editor .code li::before { width: 28px; }

/* Phone frame — no-op wrapper in classic mode, full device mockup in dev mode */
.phone-frame { position: relative; width: 100%; max-width: 380px; margin: 0 auto; }
.phone-notch, .phone-camera, .phone-home-bar { display: none; }

html.dev-mode .phone-frame {
  padding: 14px 14px 14px;
  background: linear-gradient(155deg, #29334A 0%, #131A26 55%, #05070B 100%);
  border-radius: 52px;
  box-shadow:
    0 55px 90px -30px hsl(var(--shadow-color) / 0.8),
    inset 0 0 0 2px rgba(19, 185, 253, 0.16),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.07);
}

html.dev-mode .phone-frame .device-card {
  border-radius: 38px;
  border: none;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  /* Safe area: notch/camera sit inside the screen; header clears them */
  padding: 52px 20px 36px;
}

html.dev-mode .phone-frame .device-card-header {
  margin-bottom: 22px;
}

html.dev-mode .phone-frame .device-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 45%);
  pointer-events: none;
  z-index: 1;
}

html.dev-mode .phone-frame::before,
html.dev-mode .phone-frame::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #333F58, #161D2A);
  box-shadow: inset 0 0 0 1px rgba(19, 185, 253, 0.14);
}

/* Bottom gesture bar — inside the screen, shared by both frames */
html.dev-mode .phone-frame .phone-home-bar {
  display: block;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  z-index: 3;
}

/* iPhone: Dynamic Island cut into the usable screen + side buttons */
html.dev-mode .phone-frame[data-frame="iphone"] .phone-notch {
  display: block;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 32px;
  background: #04060A;
  border-radius: 17px;
  z-index: 3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
html.dev-mode .phone-frame[data-frame="iphone"]::before {
  left: -5px; top: 100px; width: 5px; height: 38px; border-radius: 3px 0 0 3px;
}
html.dev-mode .phone-frame[data-frame="iphone"]::after {
  right: -5px; top: 124px; width: 5px; height: 96px; border-radius: 0 3px 3px 0;
}

/* Pixel: punch-hole camera inside the same screen bounds + side buttons */
html.dev-mode .phone-frame[data-frame="pixel"] {
  border-radius: 48px;
}
html.dev-mode .phone-frame[data-frame="pixel"] .device-card { border-radius: 34px; }
html.dev-mode .phone-frame[data-frame="pixel"] .phone-camera {
  display: block;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #04060A;
  box-shadow: 0 0 0 3px #1E2734, inset 0 0 0 2px rgba(19, 185, 253, 0.15);
  z-index: 3;
}
html.dev-mode .phone-frame[data-frame="pixel"]::before {
  right: -5px; top: 114px; width: 5px; height: 56px; border-radius: 0 3px 3px 0;
}
html.dev-mode .phone-frame[data-frame="pixel"]::after {
  right: -5px; top: 180px; width: 5px; height: 32px; border-radius: 0 3px 3px 0;
}

/* iPhone / Pixel picker — dev mode only */
.device-frame-toggle {
  display: none;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
html.dev-mode .device-frame-toggle { display: flex; }

.frame-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(223, 231, 242, 0.94);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.frame-btn img { display: block; width: 16px; height: 16px; }
.frame-btn:hover { border-color: var(--accent); background: #fff; transform: translateY(-2px); }
.frame-btn.active { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Stats bar: labels swap for camelCase const names */
.stat-label-dev {
  display: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
html.dev-mode .stat-label { display: none; }
html.dev-mode .stat-label-dev { display: block; }

/* Section titles become Nome.ext */
.head-dev { display: none; }
html.dev-mode .head-classic { display: none; }
html.dev-mode .head-dev { display: inline-flex; align-items: baseline; }
.head-ext { color: var(--accent); }

/* Timeline: each entry becomes its own JSON file window */
.timeline-dev { display: none; }
html.dev-mode .timeline-classic { display: none; }
html.dev-mode .timeline-dev { display: block; }
.timeline-dev .editor-window { max-width: 100%; margin: 0; }

/* Projects: each card becomes its own YAML file window */
.project-dev { display: none; }
html.dev-mode .project-classic { display: none; }
html.dev-mode .project-dev { display: block; width: 100%; }
.project-dev .editor-window { max-width: 100%; margin: 0; }
html.dev-mode .project-card {
  background: none;
  border: none;
  padding: 0;
}
html.dev-mode .project-card:hover { box-shadow: none; }

/* Contact: becomes a TXT file window */
.contact-dev { display: none; }
html.dev-mode .contact-classic { display: none; }
html.dev-mode .contact-dev { display: block; width: 100%; }
html.dev-mode .contact-card {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  align-items: stretch;
}

/* Skills: markdown-flavored headings and inline-code chips */
html.dev-mode .skill-group h3 {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  font-size: 0.95rem;
}
html.dev-mode .skill-group h3::before { content: "## "; color: var(--accent); }
html.dev-mode .skill-group .chip {
  font-family: var(--font-mono);
  background: rgba(19, 185, 253, 0.06);
}
html.dev-mode .skill-group .chip::before,
html.dev-mode .skill-group .chip::after { content: "`"; color: var(--text-faint); }

/* Education / languages: classic content vs Android XML + iOS plist */
.edu-dev, .lang-dev { display: none; }
html.dev-mode .edu-classic,
html.dev-mode .lang-classic { display: none; }
html.dev-mode .edu-dev,
html.dev-mode .lang-dev { display: block; }

.edu-dev .editor-window,
.lang-dev .editor-window { max-width: none; margin: 0; }

/* Editor window */
.editor-window {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px hsl(var(--shadow-color) / 0.6);
}

.editor-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}
.editor-tab.active { color: var(--text); }

.tab-icon {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  display: inline-block;
}
.tab-icon-dart { background: #13B9FD; }
.tab-icon-json { background: #FFB454; }
.tab-icon-yaml { background: #C3E88D; }
.tab-icon-md   { background: #82AAFF; }
.tab-icon-txt  { background: #8CA1BD; }
.tab-icon-xml  { background: #3DDC84; }
.tab-icon-plist { background: #A2AAAD; }

.editor-dots { display: flex; gap: 5px; }
.editor-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); display: block;
}

/* Code body with line-number gutter */
.code {
  list-style: none;
  margin: 0;
  padding: 18px 0 22px;
  counter-reset: line;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.code li {
  counter-increment: line;
  position: relative;
  padding: 0 22px 0 60px;
  white-space: pre-wrap;
  word-break: break-word;
}

.code li::before {
  content: counter(line);
  position: absolute;
  left: 0;
  width: 40px;
  text-align: right;
  color: var(--text-faint);
  opacity: 0.55;
  user-select: none;
}

/* Syntax tokens */
.tok-kw   { color: #82AAFF; }
.tok-type { color: #4EC9B0; }
.tok-fn   { color: #FFD880; }
.tok-str  { color: #C3E88D; }
.tok-num  { color: #F78C6C; }
.tok-key  { color: #13B9FD; }
.tok-com  { color: #5C7089; font-style: italic; }
.tok-doc  { color: #6A9955; font-style: italic; }
.tok-ann  { color: #FFB454; }

/* Markdown flavors */
.md-h1   { color: #13B9FD; font-weight: 700; }
.md-h2   { color: #82AAFF; font-weight: 600; }
.md-code {
  color: #C3E88D;
  background: rgba(195, 232, 141, 0.07);
  border-radius: 4px;
  padding: 1px 2px;
}

.code-link {
  color: #C3E88D;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(195, 232, 141, 0.4);
}
.code-link:hover { color: var(--accent); }

.code-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink { 50% { opacity: 0; } }

/* Confirmation modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 9, 15, 0.72);
  backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(460px, 100%);
  animation: modal-in .22s cubic-bezier(.2,.7,.3,1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-body { padding: 24px 24px 26px; }
.modal-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { padding: 10px 20px; font-size: 0.88rem; }

/* Terminal transition overlay */
.dev-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #0A0F17;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity .3s ease;
}
.dev-overlay[hidden] { display: none; }
.dev-overlay.closing { opacity: 0; }

.dev-terminal {
  width: min(560px, 100%);
  font-size: 0.82rem;
  line-height: 2;
  color: #8CA1BD;
}

.term-line { opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.term-line.shown { opacity: 1; transform: none; }
.term-line.term-cmd { color: #DFE7F2; }
.term-line.term-cmd::before { content: "$ "; color: #13B9FD; }
.term-line.term-ok { color: #C3E88D; }

/* ---------------------------------------------------------- */
/* Scroll reveal                                                  */
/* ---------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot, .avatar-ring { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------- */
/* Responsive                                                     */
/* ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { order: -1; }
  .device-card { max-width: 320px; }
  .phone-frame { max-width: 320px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-row { grid-template-columns: 1fr; gap: 20px; }
  .site-nav { display: none; }
}

@media (max-width: 600px) {
  .section { padding: 64px 20px; }
  .hero { padding: 48px 20px 24px; }
  .timeline-entry { grid-template-columns: 1fr; gap: 8px; }
  .timeline { border-left: none; }
  .timeline-entry { padding-left: 20px; border-left: 1px solid var(--border); }
  .timeline-entry::before { left: -5px; }
  .contact-card { padding: 40px 24px; }
  .site-header { padding: 14px 18px; }
  .stats-bar { padding: 32px 20px; }

  .devmode-label-on, .devmode-label-exit { display: none; }
  html.dev-mode .devmode-label-exit { display: none; }
  .devmode-btn { padding: 0 10px; }
  .code { font-size: 0.72rem; }
  .code li { padding: 0 14px 0 42px; }
  .code li::before { width: 28px; }
  .hero-editor .code { font-size: 0.68rem; }
  .hero-editor .code li { padding: 0 10px 0 34px; }
  .hero-editor .code li::before { width: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .code-cursor { animation: none; }
  .modal { animation: none; }
  .term-line { opacity: 1; transform: none; transition: none; }
}
