/* =========================================================
   BON JOVI F. SADAYA — PORTFOLIO STYLE SYSTEM
   Updated UI / Responsive / Automation Terminal Theme
========================================================= */

:root {
  --bg: #0d1117;
  --bg-2: #131a22;
  --bg-3: #18212b;
  --ink: #dde3ea;
  --muted: #7d8b99;
  --line: #26313c;

  --signal: #5eead4;
  --signal-dim: #2b5c54;

  --warn: #f0b86e;
  --danger: #ff7b72;

  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);

  --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* =========================
   RESET
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;

  background: var(--bg);
  color: var(--ink);

  font-family: var(--sans);
  line-height: 1.65;

  overflow-x: hidden;

  transition:
    background var(--transition),
    color var(--transition);

  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);

  background-size: 42px 42px;
  background-position: -1px -1px;
  background-attachment: fixed;

  position: relative;
}

body::before {
  content: "";

  position: fixed;
  inset: 0;

  pointer-events: none;

  z-index: -1;

  opacity: .55;

  background:
    radial-gradient(ellipse 700px 500px at 85% -5%, color-mix(in srgb, var(--signal) 18%, transparent), transparent 70%),
    radial-gradient(ellipse 600px 500px at 0% 90%, color-mix(in srgb, var(--warn) 12%, transparent), transparent 70%);
}

/* LIGHT MODE */

body.dark-mode {
  --bg: #f5f2ea;
  --bg-2: #ebe6da;
  --bg-3: #e3dccd;

  --ink: #1b232c;
  --muted: #6b7682;
  --line: #d6cfbf;

  --signal: #0f8f7e;
  --signal-dim: #bfe6df;

  --warn: #b9701f;
}

/* =========================
   GLOBAL ELEMENTS
========================= */

a {
  color: inherit;
}

button {
  font-family: inherit;
}

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

/* ACCESSIBILITY */

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* REDUCE MOTION */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* =========================
   TOP STATUS BAR
========================= */

.topstrip {
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;

  padding: .75rem 1.5rem;

  border-bottom: 1px solid var(--line);

  color: var(--muted);

  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;

  background: color-mix(in srgb, var(--bg) 85%, transparent);

  backdrop-filter: blur(10px);
}

.topstrip .dot {
  color: var(--signal);
  animation: blink 2s infinite;
}

@keyframes blink {
  50% {
    opacity: .35;
  }
}

/* THEME BUTTON */

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;

  padding: .4rem .9rem;

  background: transparent;
  color: var(--ink);

  border: 1px solid var(--line);
  border-radius: 5px;

  cursor: pointer;

  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;

  transition:
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

#theme-toggle:hover {
  border-color: var(--signal);
  color: var(--signal);
  transform: translateY(-2px);
}

/* =========================
   HERO / HEADER
========================= */

header {
  max-width: 1080px;

  margin: 0 auto;

  padding: 5rem 1.5rem 3rem;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);

  gap: 3rem;

  align-items: center;

  position: relative;
}

.hero-text {
  grid-column: 1;
}

.hero-art {
  grid-column: 2;

  width: 100%;
  min-height: 420px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
}

.hero-art svg {
  width: 100%;
  max-width: 460px;
  height: auto;

  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35));
}

#hero-orbit-mount {
  position: absolute;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;
}

/* INTRO LABEL */

.welcome {
  margin: 0 0 1rem;

  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: .28em;
  text-transform: uppercase;

  color: var(--muted);
}

/* STATUS */

.status-line {
  display: flex;
  align-items: center;
  gap: .65rem;

  margin-bottom: 1rem;

  color: var(--signal);

  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.status-line .pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;

  background: var(--signal);

  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, .5);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(94, 234, 212, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0);
  }
}

/* TITLE */

header h1 {
  margin: 0 0 1.3rem;

  font-family: var(--sans);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-weight: 750;
}

header .lede {
  max-width: 650px;

  margin: 0 0 1.5rem;

  font-size: 1.08rem;

  color: var(--ink);
}

header .lede strong {
  color: var(--signal);
  font-weight: 650;
}

/* CREDENTIAL BOX */

.credentials {
  max-width: 650px;

  margin: 0 0 2rem;

  padding: 1rem 1.2rem;

  background: var(--bg-2);

  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);

  color: var(--muted);

  font-family: var(--mono);
  font-size: .8rem;

  box-shadow: var(--shadow);
}

.credentials span {
  color: var(--warn);
}

/* MAIN CTA */

.cv-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;

  padding: .9rem 1.7rem;

  background: var(--signal);
  color: var(--bg);

  border-radius: 6px;

  text-decoration: none;

  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .05em;

  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.cv-button:hover {
  transform: translateY(-3px);

  box-shadow: 0 12px 30px color-mix(in srgb, var(--signal) 25%, transparent);
}

/* =========================
   NAVIGATION
========================= */

nav {
  position: sticky;
  top: 0.75rem;
  z-index: 100;

  max-width: 980px;

  margin: 0 auto;

  padding: 1rem 1.5rem;

  display: flex;
  flex-wrap: wrap;

  gap: .8rem 2rem;

  align-items: center;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: color-mix(in srgb, var(--bg-2) 92%, transparent);

  backdrop-filter: blur(12px);

  font-family: var(--mono);
  font-size: .82rem;
}

nav a {
  color: var(--muted);

  text-decoration: none;

  white-space: nowrap;

  position: relative;

  transition: color var(--transition);
}

nav a::after {
  content: "";

  position: absolute;
  left: 0;
  bottom: -6px;

  width: 0;
  height: 1px;

  background: var(--signal);

  transition: width var(--transition);
}

nav a:hover {
  color: var(--signal);
}

nav a:hover::after {
  width: 100%;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
  max-width: 980px;

  margin: 0 auto;

  padding: 4rem 1.5rem 2rem;
}

.container > h2 {
  margin: 0 0 .5rem;

  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .25em;
  text-transform: uppercase;

  color: var(--muted);
}

.container-intro {
  max-width: 680px;

  margin: .5rem 0 3rem;

  color: var(--muted);
  font-size: 1rem;
}

/* =========================
   FEATURED PROJECT GRID
========================= */

.featured-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 1.5rem;

  margin-bottom: 3rem;
}

/* PROJECT CARD */

.feat-card {
  position: relative;

  display: flex;
  flex-direction: column;

  min-height: 330px;

  padding: 1.6rem 1.4rem;

  background: linear-gradient(145deg, var(--bg-2), var(--bg-3));

  border: 1px solid var(--line);
  border-radius: var(--radius);

  overflow: hidden;

  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.feat-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;
  right: 0;

  height: 3px;

  background: var(--signal);

  opacity: .65;
}

.feat-card:hover {
  transform: translateY(-6px);

  border-color: var(--signal-dim);

  box-shadow: var(--shadow);
}

/* CARD TAG */

.feat-tag {
  margin-bottom: .8rem;

  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;

  color: var(--signal);
}

/* CARD TITLE */

.feat-card h3 {
  margin: 0 0 .8rem;

  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 750;
}

/* CARD TEXT */

.feat-card p {
  flex: 1;

  margin: 0 0 1rem;

  color: var(--muted);
  font-size: .92rem;
}

.feat-card p strong {
  color: var(--ink);
}

/* =========================
   TECH STACK TAGS
========================= */

.stack {
  display: flex;

  flex-wrap: wrap;

  gap: .35rem;

  margin: 0 0 1.2rem;

  font-family: var(--mono);
  font-size: .68rem;
}

.stack span {
  padding: .2rem .5rem;

  border: 1px solid var(--line);
  border-radius: 4px;

  color: var(--muted);

  background: color-mix(in srgb, var(--bg) 50%, transparent);
}

/* PROJECT LINK */

.contact-btn {
  align-self: flex-start;

  margin-top: auto;

  font-family: var(--mono);
  font-size: .78rem;

  color: var(--signal);

  text-decoration: none;

  border-bottom: 1px solid var(--signal-dim);

  padding-bottom: 2px;

  transition:
    color var(--transition),
    border-color var(--transition);
}

.contact-btn:hover {
  color: var(--ink);
  border-color: var(--signal);
}

/* =========================
   VIEW ALL LINK
========================= */

.view-all-wrap {
  text-align: right;

  margin-bottom: 3rem;
}

.view-all-wrap a {
  font-family: var(--mono);
  font-size: .78rem;

  color: var(--muted);

  text-decoration: none;

  border-bottom: 1px solid var(--line);
}

.view-all-wrap a:hover {
  color: var(--signal);
}

/* =========================
   SERVICE BLOCK
========================= */

.service-block {
  position: relative;

  padding: 1.8rem 1.5rem;

  margin-bottom: 3rem;

  background: linear-gradient(145deg, var(--bg-2), var(--bg-3));

  border: 1px solid var(--warn);
  border-radius: var(--radius);

  overflow: hidden;
}

.service-block::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;
  right: 0;

  height: 3px;

  background: var(--warn);

  opacity: .7;
}

.service-tag {
  display: block;

  margin-bottom: .7rem;

  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;

  color: var(--warn);
}

.service-block h3 {
  margin: 0 0 .6rem;

  font-size: 1.25rem;
}

.service-block p {
  max-width: 620px;

  color: var(--muted);
}

/* =========================
   BACK TO TOP BUTTON
========================= */

#back-to-top {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 200;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 50%;

  color: var(--signal);
  cursor: pointer;

  font-family: var(--mono);
  font-size: 1.1rem;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);

  transition: opacity .25s ease, transform .25s ease, border-color .2s ease, visibility .25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  border-color: var(--signal);
  transform: translateY(-3px);
}

#back-to-top:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #back-to-top { transition: opacity .1s linear; }
  #back-to-top:hover { transform: none; }
}
