/* =============================================================================
   rootxero — terminal stylesheet
   Direction: modern dark "terminal app" window (iTerm / VS Code integrated
   terminal). One disciplined palette, a single characterful monospace, and a
   window-chrome frame as the signature element.
   ============================================================================= */

/* ---- Design tokens --------------------------------------------------------- */
:root {
  /* Palette (Tokyo-Night-inspired, custom) */
  --bg:        #0f1117;   /* page background, just behind the window */
  --term-bg:   #14161d;   /* terminal surface */
  --titlebar:  #1b1e27;   /* window title bar */
  --border:    #262a35;   /* hairline borders */
  --bg-elev:   #1b1e27;   /* elevated surfaces (chips) */
  --fg:        #d4d8e0;   /* default text */
  --dim:       #6a7187;   /* muted text (timestamps, comments) */

  --green:     #9ece6a;   /* prompt, success, [ OK ] */
  --cyan:      #7dcfff;   /* commands, accents */
  --blue:      #7aa2f7;   /* headings, links */
  --amber:     #e0af68;   /* labels / keys */
  --magenta:   #bb9af7;   /* secondary accent */
  --red:       #f7768e;   /* errors */

  /* Type */
  --mono: 'JetBrains Mono', 'SFMono-Regular', 'SF Mono', 'Cascadia Code',
          'Fira Code', Menlo, Consolas, 'Liberation Mono', monospace;
  --fs:   15px;           /* base font size */
  --lh:   1.65;           /* line height */
}

/* ---- Reset / base ---------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #181b24 0%, var(--bg) 60%);
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--fs);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---- Window frame (the signature element) ---------------------------------- */
.window {
  width: min(960px, 100%);
  height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* Title bar with traffic-light dots and a tab-like label */
.titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.dots { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.title {
  flex: 1 1 auto;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Language toggle lives in the title bar */
.lang-toggle {
  display: flex;
  gap: 2px;
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  cursor: pointer;
}

.home-link{
  font-family: inherit;
  font-size: 13px;
  color: #8b85f0;              /* ton périwinkle */
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(139,133,240,.4);
  border-radius: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.home-link:hover{
  border-color: #8b85f0;
  background: rgba(139,133,240,.12);
}

.lang-toggle button.active { background: var(--blue); color: #0b0d12; }
.lang-toggle button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

/* ---- Scrollable output ----------------------------------------------------- */
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.screen::-webkit-scrollbar { width: 10px; }
.screen::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

/* Each printed block */
.line { white-space: pre-wrap; word-break: break-word; }
.line + .line { margin-top: 0; }

/* Color utility classes used when printing */
.c-green   { color: var(--green); }
.c-cyan    { color: var(--cyan); }
.c-blue    { color: var(--blue); }
.c-amber   { color: var(--amber); }
.c-magenta { color: var(--magenta); }
.c-red     { color: var(--red); }
.c-dim     { color: var(--dim); }
.bold      { font-weight: 700; }

a { color: var(--cyan); text-decoration: none; border-bottom: 1px dotted var(--cyan); }
a:hover { color: var(--blue); }

/* The command echo line: prompt + the text the user typed */
.echo .prompt { margin-right: 8px; }
.prompt .user { color: var(--green); }
.prompt .at   { color: var(--dim); }
.prompt .host { color: var(--magenta); }
.prompt .sep  { color: var(--dim); }
.prompt .path { color: var(--blue); }
.prompt .sign { color: var(--fg); }

/* Banner (ASCII art) */
.banner {
  color: var(--blue);
  line-height: 1.15;
  margin: 4px 0 10px;
  font-size: clamp(7px, 1.9vw, 13px);
  white-space: pre;
}

/* neofetch two-column layout */
.neofetch { display: flex; gap: 22px; flex-wrap: wrap; }
.neofetch .logo { color: var(--blue); white-space: pre; line-height: 1.15; }
.neofetch .info .k { color: var(--amber); }

/* Section headers used by skills/experience/education */
.section-title { color: var(--blue); font-weight: 700; margin-top: 4px; }
.rule { color: var(--border); }

/* ---- Input line ------------------------------------------------------------ */
.inputline {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 20px 16px;
  border-top: 1px solid var(--border);
}
/* The actual text field is invisible; we render a fake caret over it */
#cmd {
  flex: 1 1 auto;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--cyan);
}
#cmd::placeholder { color: var(--dim); }

/* Blinking block cursor shown during the boot sequence */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  background: var(--green);
  transform: translateY(0.18em);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Clickable command chips ----------------------------------------------- */
.cmdbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 2px;
}
.cmd-chip {
  appearance: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  background: var(--bg-elev, #1b1e27);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, transform 0.06s ease;
}
.cmd-chip::before { content: ''; }            /* keep label clean (no $ prefix) */
.cmd-chip:hover {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}
.cmd-chip:active { transform: translateY(1px); }
.cmd-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- CV PDF viewer --------------------------------------------------------- */
.cv-viewer { margin: 8px 0 4px; }
.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.btn {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bg);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 7px;
  padding: 7px 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost {
  color: var(--cyan);
  background: transparent;
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.cv-frame {
  width: 100%;
  height: min(68vh, 620px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;        /* PDFs render on white */
}

/* Honeypot: visually hidden, off-screen; bots that fill it are dropped. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---- Accessibility: respect reduced motion --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

/* ---- Mobile: go full-bleed ------------------------------------------------- */
@media (max-width: 640px) {
  body { padding: 0; }
  .window { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  :root { --fs: 14px; }
  .title { display: none; }
  .cmd-chip { font-size: 12px; padding: 6px 10px; }  /* easier to tap */
  .cv-frame { height: 60vh; }
  .cv-actions .btn { flex: 1 1 auto; text-align: center; }
}
