/* anilbostanci.com: console homepage.
   Scoped to the home template; Attila's own styles are untouched. */

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
  }
  @font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
  }

  :root {
    --bg: hsl(0 26% 3.5%);
    --panel: hsl(0 22% 8%);
    --panel2: hsl(0 22% 10.5%);
    --text: hsl(0 16% 91%);
    --muted: hsl(0 10% 69%);
    --faint: hsl(0 9% 42%);
    --phos: #f07a7a;
    --phos-dim: hsl(0 64% 42%);
    --line: hsl(0 35% 65% / 0.2);
    --line-bright: color-mix(in srgb, var(--phos) 34%, transparent);
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
    --aw-bg: #05070d;
    --aw-text: #e9edf6;
    --aw-muted: #98a1b3;
    --aw-cyan: #7de9ff;
  }

  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
  }

  ::selection { background: color-mix(in srgb, var(--phos) 28%, transparent); }
  a { color: inherit; text-decoration: none; }
  :focus-visible { outline: 1.5px solid var(--phos); outline-offset: 3px; border-radius: 3px; }

  /* ---------- CRT atmosphere ---------- */
  .scan {
    position: fixed; inset: 0; z-index: 50; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
    opacity: 0.45;
  }
  .vignette {
    position: fixed; inset: 0; z-index: 49; pointer-events: none;
    background: radial-gradient(130% 130% at 50% 38%, transparent 55%, rgba(0, 0, 0, 0.5));
  }

  .wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
  .breath {
    position: fixed; left: 50%; top: 32%; z-index: 0; pointer-events: none;
    width: 950px; height: 640px; transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--phos) 6%, transparent), transparent 70%);
    animation: breath 7s ease-in-out infinite alternate;
  }
  @keyframes breath { to { opacity: 0.45; transform: translate(-50%, -50%) scale(1.1); } }

  /* ---------- console header ---------- */
  header.console {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 22px 4px 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap;
  }
  .sig { color: var(--text); font-weight: 500; }
  .sig .dot { color: var(--phos); }
  .hud { display: flex; gap: 18px; align-items: baseline; }
  .hud a { color: var(--muted); transition: color 0.15s, text-shadow 0.15s; }
  .hud a:hover { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 50%, transparent); }
  #clock { color: var(--faint); font-variant-numeric: tabular-nums; }
  .pal { display: flex; gap: 9px; align-items: center; }
  .pal span { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
  .pal input[type="color"] {
    width: 22px; height: 22px; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: 50%; background: none;
    transition: box-shadow 0.2s ease;
  }
  .pal input[type="color"]:hover { box-shadow: 0 0 12px color-mix(in srgb, var(--phos) 50%, transparent); }
  .pal input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
  .pal input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
  #hueHex { font-size: 11px; color: var(--phos); font-variant-numeric: tabular-nums; }

  /* ---------- grid + circuit traces ---------- */
  .grid {
    display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 18px; padding: 12px 0 16px;
    position: relative;
  }
  #traceSvg {
    position: absolute; inset: 0; z-index: 2;
    width: 100%; height: 100%;
    pointer-events: none; overflow: visible;
  }
  .trace { fill: none; stroke: var(--line); stroke-width: 1.5; }
  .trace-glow {
    fill: none; stroke: color-mix(in srgb, var(--phos) 72%, white); stroke-width: 2; stroke-linecap: round;
    stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
    transition: stroke-dashoffset 0.3s linear, opacity 0.18s linear;
    filter: drop-shadow(0 0 3px var(--phos)) drop-shadow(0 0 9px color-mix(in srgb, var(--phos) 75%, transparent));
  }
  .trace-glow.lit { stroke-dashoffset: 0; opacity: 1; }
  .via { fill: var(--faint); }
  .via-glow {
    fill: color-mix(in srgb, var(--phos) 65%, white); opacity: 0;
    transition: opacity 0.15s linear;
    filter: drop-shadow(0 0 4px var(--phos)) drop-shadow(0 0 10px color-mix(in srgb, var(--phos) 75%, transparent));
  }
  .via-glow.lit { opacity: 1; }
  .grid .t.energized {
    border-color: color-mix(in srgb, var(--phos) 72%, white);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--phos) 16%, transparent),
      0 10px 30px rgba(0, 0, 0, 0.45),
      0 0 0 1px color-mix(in srgb, var(--phos) 60%, transparent),
      0 0 12px color-mix(in srgb, var(--phos) 50%, transparent),
      0 0 36px color-mix(in srgb, var(--phos) 24%, transparent);
  }
  .t {
    position: relative; overflow: hidden; z-index: 1;
    grid-column: span 4;
    background: linear-gradient(175deg, var(--panel2), var(--panel));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 22px;
    opacity: 0;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--phos) 7%, transparent), 0 10px 30px rgba(0, 0, 0, 0.45);
    animation: boot 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
    animation-delay: calc(var(--i, 0) * 90ms);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  }
  .t:hover {
    border-color: var(--line-bright);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--phos) 10%, transparent),
      0 14px 36px rgba(0, 0, 0, 0.5),
      0 0 0 1px color-mix(in srgb, var(--phos) 10%, transparent),
      0 0 38px color-mix(in srgb, var(--phos) 9%, transparent);
  }
  @keyframes boot {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  .s7 { grid-column: span 7; }
  .s5 { grid-column: span 5; }
  .s12 { grid-column: span 12; }
  @media (max-width: 920px) {
    .t, .s7, .s5 { grid-column: span 6; }
    .s12 { grid-column: span 12; }
  }
  @media (max-width: 620px) {
    .t, .s7, .s5, .s12 { grid-column: span 12; }
  }

  .t-lab {
    display: flex; align-items: center; gap: 9px;
    font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 16px;
  }
  .led { width: 7px; height: 7px; border-radius: 50%; flex: none; }
  .led.g { background: var(--phos); box-shadow: 0 0 10px color-mix(in srgb, var(--phos) 70%, transparent); }
  .led.o { background: transparent; border: 1.2px solid var(--faint); }
  .led.pulse { animation: pulse 2s ease infinite; }
  @keyframes pulse { 50% { opacity: 0.35; box-shadow: none; } }

  /* ---------- ID tile ---------- */
  .id-tile { padding: 26px 28px; }
  .id-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; margin-top: 4px; }
  @media (max-width: 860px) { .id-cols { grid-template-columns: 1fr; gap: 12px; } }
  h1 {
    margin: 0 0 4px;
    font-size: clamp(1.5rem, 4.4vw, 2.3rem);
    font-weight: 500; letter-spacing: 0.04em; line-height: 1.15;
    color: #e4f0e0;
    text-shadow: 0 0 22px color-mix(in srgb, var(--phos) 28%, transparent);
    text-transform: uppercase;
  }
  .caret { display: inline-block; width: 0.45ch; height: 0.72em; margin-left: 6px; background: var(--phos); box-shadow: 0 0 12px color-mix(in srgb, var(--phos) 70%, transparent); animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .role { font-size: 12.5px; color: var(--phos-dim); letter-spacing: 0.04em; margin: 0 0 18px; }
  .role .neon {
    color: color-mix(in srgb, var(--phos) 72%, white);
    font-weight: 500;
    text-shadow: 0 0 5px var(--phos), 0 0 14px color-mix(in srgb, var(--phos) 75%, transparent),
      0 0 30px color-mix(in srgb, var(--phos) 40%, transparent);
  }
  .id-tile p.pitch { margin: 0 0 12px; color: var(--muted); max-width: 52ch; font-weight: 500; }
  .id-tile p.pitch b { color: var(--text); font-weight: 500; }
  .id-side { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
  .quip { color: var(--text) !important; }
  .brackets { display: flex; gap: 14px; margin-top: 2px; flex-wrap: wrap; }
  .brackets a { font-size: 12.5px; color: var(--muted); transition: color 0.15s, text-shadow 0.15s; }
  .brackets a:hover { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 50%, transparent); }

  /* ---------- now tile ---------- */
  .log { display: grid; gap: 10px; font-size: 12.5px; }
  .log p {
    margin: 0; color: var(--muted);
    opacity: 0; transform: translateY(5px);
    animation: linein 0.45s ease forwards;
  }
  .log p:nth-child(1) { animation-delay: 1s; }
  .log p:nth-child(2) { animation-delay: 1.45s; }
  .log p:nth-child(3) { animation-delay: 1.9s; }
  @keyframes linein { to { opacity: 1; transform: none; } }
  .log p b { color: var(--text); font-weight: 500; }
  .log .pfx { color: var(--phos-dim); margin-right: 6px; }
  .slot { color: var(--phos); }

  /* ---------- work tiles ---------- */
  .s3 { grid-column: span 3; }
  @media (max-width: 920px) { .s3 { grid-column: span 6; } }
  @media (max-width: 620px) { .s3 { grid-column: span 12; } }
  .t h3 {
    display: flex; align-items: center; gap: 9px;
    margin: 0 0 4px; font-size: 15px; font-weight: 500; letter-spacing: 0.01em; color: var(--text);
  }
  .t h3 { align-items: flex-start; }
  .t h3 .led { margin-top: 6px; }
  .t h3 a { display: inline-flex; align-items: baseline; gap: 5px; transition: color 0.15s, text-shadow 0.15s; }
  .t h3 a:hover { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 50%, transparent); }
  .t h3 .ext { font-size: 11px; color: var(--faint); transition: color 0.15s; }
  .t h3 a:hover .ext { color: var(--phos); }
  .meta { font-size: 10.5px; color: var(--muted); margin-bottom: 1px; white-space: nowrap; }
  .org { font-size: 10.5px; color: var(--faint); margin-bottom: 11px; }
  .t p.desc { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }

  /* ---------- PR tile ---------- */
  /* minmax(0,…) so a long PR title cannot push its column wider than its
     share; without it the columns go lopsided. Long titles wrap onto a
     second line rather than being cut. */
  .pr-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 34px; }
  @media (max-width: 760px) { .pr-cols { grid-template-columns: 1fr; gap: 18px; } }
  .pr-repo {
    font-size: 11px; color: var(--muted); margin-bottom: 8px;
    padding-bottom: 7px; border-bottom: 1px dashed var(--line);
  }
  .pr-repo a { transition: color 0.15s, text-shadow 0.15s; }
  .pr-repo a:hover { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 50%, transparent); }
  .pr-repo .ext { font-size: 10px; color: var(--faint); margin-left: 4px; }
  .pr {
    display: flex; align-items: baseline; gap: 10px;
    padding: 5px 0; font-size: 12px;
  }
  .pr .num { color: var(--phos-dim); flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .pr .title {
    color: var(--muted); flex: 1 1 auto; min-width: 0; line-height: 1.5;
    transition: color 0.15s, text-shadow 0.15s;
  }
  .pr:hover .title { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 45%, transparent); }
  .pr .when { margin-left: auto; flex: none; white-space: nowrap; font-size: 10.5px; color: var(--faint); }

  /* ---------- notes tile ---------- */
  .note-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; }
  .note-row + .note-row { border-top: 1px dashed rgba(120, 160, 118, 0.13); }
  .note-row .o { color: var(--faint); flex: none; }
  .note-title { font-size: 13px; color: var(--text); transition: color 0.15s, text-shadow 0.15s; }
  .note-row:hover .note-title { color: var(--phos); text-shadow: 0 0 12px color-mix(in srgb, var(--phos) 40%, transparent); }
  .note-row .fill { flex: 1; }
  .note-tag { font-size: 10.5px; color: var(--faint); flex: none; }
  .sub-line { margin: 16px 0 0; font-size: 11.5px; color: var(--faint); }
  .sub-line a { color: var(--muted); }
  .sub-line a:hover { color: var(--phos); }

  /* ---------- readout tile ---------- */
  .readout { display: grid; gap: 9px; font-size: 12.5px; }
  .readout .r { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .readout .k { color: var(--muted); }
  .readout .dots { flex: 1; border-bottom: 1px dotted rgba(120, 160, 118, 0.2); transform: translateY(-3px); }
  .readout .v { color: var(--phos); font-weight: 500; font-variant-numeric: tabular-nums; text-shadow: 0 0 10px color-mix(in srgb, var(--phos) 35%, transparent); }

  /* ---------- AW doorway tile ---------- */
  .t.aw {
    background: var(--aw-bg);
    border-color: rgba(125, 233, 255, 0.2);
  }
  .t.aw:hover { border-color: rgba(125, 233, 255, 0.4); box-shadow: 0 0 34px rgba(59, 158, 255, 0.1); }
  .t.aw::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
    background:
      radial-gradient(280px 120px at 10% -30%, rgba(59, 158, 255, 0.3), transparent 70%),
      radial-gradient(240px 120px at 90% 130%, rgba(236, 67, 115, 0.16), transparent 70%);
  }
  .t.aw > * { position: relative; }
  .t.aw .t-lab { color: var(--aw-muted); }
  .t.aw h3 { color: var(--aw-text); }
  .t.aw h3 a:hover { color: var(--aw-cyan); text-shadow: 0 0 12px rgba(125, 233, 255, 0.5); }
  .t.aw h3 a:hover .ext { color: var(--aw-cyan); }
  .t.aw p.desc { color: var(--aw-muted); }
  .t.aw .go { display: inline-block; margin-top: 14px; font-size: 12px; color: var(--aw-cyan); }

  /* ---------- contact tile ---------- */
  .contact-tile p { margin: 0; font-size: 14px; color: var(--muted); max-width: 60ch; font-weight: 500; }
  .contact-tile a.mail {
    color: var(--text); border-bottom: 1px solid var(--phos-dim);
    transition: color 0.15s, text-shadow 0.15s, border-color 0.15s;
  }
  .contact-tile a.mail .ext { font-size: 11px; color: var(--faint); transition: color 0.15s; }
  .contact-tile a.mail:hover .ext { color: var(--phos); }
  .contact-tile a.mail:hover { color: var(--phos); border-color: var(--phos); text-shadow: 0 0 14px color-mix(in srgb, var(--phos) 50%, transparent); }

  /* ---------- footer ---------- */
  footer.console {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 10px 4px 40px; font-size: 11px; color: var(--faint);
  }
  footer.console a { color: var(--muted); }
  footer.console a:hover { color: var(--phos); }
  .concept-tag { border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; letter-spacing: 0.08em; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .t { opacity: 1; animation: none; }
    .log p { opacity: 1; transform: none; animation: none; }
    .caret, .led.pulse, .breath { animation: none; }
  }
