/* ==========================================================================
   RomPC — interactive UI layer
   Palette: #222831 ink · #393E46 steel · #00ADB5 brand · #EEEEEE cloud

   Everything animated here runs on transform/opacity only (compositor-friendly)
   and is fully disabled under prefers-reduced-motion.

   Direction: all offsets use CSS logical properties, so flipping <html dir>
   mirrors the layout with no extra rules.
   ========================================================================== */

:root {
  --ink: #222831;
  --ink-deep: #1B2027;
  --steel: #393E46;
  --steel-up: #4A515B;
  --brand: #00ADB5;
  --brand-light: #1FC8D0;
  --cloud: #EEEEEE;
  --cloud-dim: #A7AEB8;
  --cloud-faint: #767E89;

  --line: rgba(238, 238, 238, .08);
  --line-strong: rgba(238, 238, 238, .16);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
body {
  overflow-x: hidden;
  line-height: 1.6;

  /* The dark theme comes from the Tailwind classes on <body> (bg-ink
     text-cloud), and Tailwind is loaded at runtime from a CDN. If that request
     is slow, blocked, or fails on a phone's data connection, the page renders
     white with black text - or with nothing visible at all. Repeating the two
     base colours here costs nothing when Tailwind loads (identical values) and
     keeps the site readable when it does not. */
  background-color: var(--ink);
  color: var(--cloud);
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--ink-deep); }
::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* ======================================================= ambient texture */
/* fine film grain — sits above the background, below everything else */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 4%); }
  40%  { transform: translate(3%, -7%); }
  60%  { transform: translate(-4%, -3%); }
  80%  { transform: translate(5%, 5%); }
  100% { transform: translate(0, 0); }
}

/* slow drifting colour wash behind the hero */
.aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}
.aura-1 {
  width: 480px; height: 480px;
  background: rgba(0, 173, 181, .10);
  inset-block-start: -160px;
  inset-inline-end: -80px;
  animation: drift1 18s ease-in-out infinite;
}
.aura-2 {
  width: 380px; height: 380px;
  background: rgba(57, 62, 70, .32);
  inset-block-end: -140px;
  inset-inline-start: -60px;
  animation: drift2 22s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-40px, 50px) scale(1.12); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, -40px) scale(1.08); }
}

/* ========================================================= custom cursor */
body.has-cursor,
body.has-cursor a,
body.has-cursor button { cursor: none; }

#cursor-dot,
#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s ease;
}
body.has-cursor #cursor-dot,
body.has-cursor #cursor-ring { opacity: 1; }

#cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--brand-light);
  box-shadow: 0 0 10px rgba(0, 173, 181, .9);
}
#cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(0, 173, 181, .55);
  transition: opacity .3s ease, width .28s var(--ease), height .28s var(--ease),
              margin .28s var(--ease), background-color .28s var(--ease),
              border-color .28s var(--ease);
}
#cursor-ring.hot {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: rgba(0, 173, 181, .1);
  border-color: rgba(0, 173, 181, .9);
}

/* ======================================================= scroll progress */
#progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  box-shadow: 0 0 14px rgba(0, 173, 181, .8);
  will-change: transform;
}
[dir="rtl"] #progress { transform-origin: right center; }

/* ================================================================ header */
#site-header {
  transition: background-color .4s var(--ease), border-color .4s var(--ease),
              backdrop-filter .4s var(--ease);
}
#site-header.scrolled {
  background: rgba(27, 32, 39, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.nav-link {
  position: relative;
  padding-block: .3rem;
  transition: color .25s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  height: 1px;
  width: 100%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .4s var(--ease);
}
[dir="rtl"] .nav-link::after { transform-origin: left center; }
.nav-link:hover { color: var(--cloud); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left center; }
[dir="rtl"] .nav-link:hover::after { transform-origin: right center; }
.nav-link.active { color: var(--brand); }
.nav-link.active::after { transform: scaleX(1); }

/* ========================================================= language pill */
.lang-btn {
  position: relative;
  overflow: hidden;
  min-width: 46px;
  padding: .45rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--cloud-dim);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.lang-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .32s var(--ease);
  z-index: -1;
}
.lang-btn:hover {
  color: var(--ink);
  border-color: var(--brand);
}
.lang-btn:hover::before { transform: scaleY(1); }

/* =============================================================== buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  overflow: hidden;
  border-radius: 5px;
  background: var(--brand);
  color: var(--ink);
  font-weight: 700;
  font-size: .9375rem;
  padding: .9rem 2rem;
  isolation: isolate;
  transition: box-shadow .35s var(--ease), color .3s var(--ease);
  will-change: transform;
}
.btn > * { position: relative; z-index: 2; }

/* the fill wipes across from the pointer's side on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--brand-light);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .45s var(--ease);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left center; }
.btn:hover { box-shadow: 0 14px 40px -14px rgba(0, 173, 181, .85); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn-sm { padding: .55rem 1.2rem; font-size: .8125rem; }
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1rem; }

.btn-ghost {
  background: transparent;
  color: var(--cloud);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost::before { background: rgba(0, 173, 181, .12); }
.btn-ghost:hover {
  color: var(--brand-light);
  box-shadow: inset 0 0 0 1px rgba(0, 173, 181, .65);
}

/* ================================================================ pieces */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
  transform-origin: left center;
  animation: eyeline 1s var(--ease) both;
}
[dir="rtl"] .eyebrow::before { transform-origin: right center; }
@keyframes eyeline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* headline claim under the hero tagline */
.note {
  position: relative;
  border-inline-start: 2px solid transparent;
  padding-inline-start: 1.25rem;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--cloud);
}
.note::before {
  content: "";
  position: absolute;
  inset-inline-start: -2px;
  inset-block: 0;
  width: 2px;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(0, 173, 181, .8);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .9s var(--ease) .35s;
}
.reveal.in .note::before,
.note.lit::before { transform: scaleY(1); }
@media (min-width: 640px) {
  .note { font-size: 1.5rem; }
}

/* the scramble effect swaps characters while settling */
.scramble { white-space: pre-wrap; }

/* =============================================================== marquee */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 1.1rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: slide 38s linear infinite;
}
[dir="rtl"] .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding-inline-end: 2.5rem;
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--cloud-faint);
  white-space: nowrap;
  transition: color .25s var(--ease);
}
.marquee-item::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .55;
}
.marquee:hover .marquee-item { color: var(--cloud-dim); }

/* ============================================================== services */
.svc {
  position: relative;
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(238, 238, 238, .012);
  transform-style: preserve-3d;
  transition: border-color .4s var(--ease), background-color .4s var(--ease),
              box-shadow .4s var(--ease);
  will-change: transform;
}
.svc:hover {
  border-color: rgba(0, 173, 181, .45);
  background: rgba(0, 173, 181, .035);
  box-shadow: 0 24px 60px -30px rgba(0, 173, 181, .7);
}

/* cursor-tracking sheen */
.svc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(0, 173, 181, .16), transparent 65%);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.svc:hover::after { opacity: 1; }

.svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block-end: .9rem;
  border-block-end: 1px solid var(--line);
}
.svc h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--cloud);
}
.svc-num {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--cloud-faint);
  transition: color .3s var(--ease);
}
.svc:hover .svc-num { color: var(--brand); }

.svc ul {
  margin-block-start: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.svc li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--cloud-dim);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .55s var(--ease) var(--d, 0ms),
              transform .55s var(--ease) var(--d, 0ms),
              color .25s var(--ease);
}
.svc.in li { opacity: 1; transform: none; }
.svc li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: .55rem;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--brand);
  transition: width .3s var(--ease), box-shadow .3s var(--ease);
}
.svc:hover li::before {
  width: 12px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 173, 181, .9);
}
.svc:hover li { color: var(--cloud); }

/* ============================================================= accordion */
.acc { border-block-end: 1px solid var(--line); }
.acc:first-child { border-block-start: 1px solid var(--line); }

.acc-q {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem .25rem;
  text-align: start;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--cloud);
  transition: color .3s var(--ease), padding-inline-start .35s var(--ease);
}
.acc-q::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 1.1rem;
  width: 2px;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
  transform: scaleY(0);
  transition: transform .35s var(--ease);
}
.acc-q:hover,
.acc[data-open="true"] .acc-q { color: var(--brand-light); }
.acc-q:hover { padding-inline-start: 1.1rem; }
.acc-q:hover::before { transform: scaleY(1); }

.acc-icon {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--cloud-faint);
  transition: transform .45s var(--ease), color .3s var(--ease);
}
.acc[data-open="true"] .acc-icon {
  transform: rotate(180deg);
  color: var(--brand);
}

/* animated open/close via grid rows — no height maths, nothing to get stuck */
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .45s var(--ease), visibility 0s linear .45s;
}
.acc[data-open="true"] .acc-body {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows .45s var(--ease), visibility 0s;
}
.acc-inner-clip { min-height: 0; overflow: hidden; }

.acc-inner {
  padding-block: .25rem 1.7rem;
  padding-inline-end: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--cloud-dim);
  line-height: 1.8;
}

.opts { display: flex; flex-direction: column; gap: 1.15rem; }
.opts dt {
  font-weight: 700;
  color: var(--cloud);
  transition: color .25s var(--ease);
}
.opts dt:hover { color: var(--brand-light); }
.opts dd { margin-block-start: .2rem; color: var(--cloud-dim); }

/* ================================================================== form */
.form-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(238, 238, 238, .015);
  padding: 2rem 1.75rem;
  overflow: hidden;
}
/* a hairline that lights up along the top edge when the card is on screen */
.form-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  transform: scaleX(0);
  transition: transform 1.2s var(--ease) .2s;
}
.reveal.in.form-card::before { transform: scaleX(1); }
@media (min-width: 640px) {
  .form-card { padding: 2.5rem; }
}

.field { position: relative; }
.field label {
  display: block;
  margin-block-end: .6rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--cloud);
  transition: color .25s var(--ease);
}
.field:focus-within label { color: var(--brand); }

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(27, 32, 39, .55);
  padding: .9rem 1rem;
  font-size: .9375rem;
  font-family: inherit;
  color: var(--cloud);
  transition: border-color .3s var(--ease), background-color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.field textarea { line-height: 1.65; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #616974; }
.field input:hover,
.field textarea:hover { border-color: rgba(238, 238, 238, .28); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(27, 32, 39, .85);
  box-shadow: 0 0 0 3px rgba(0, 173, 181, .13), 0 0 26px -8px rgba(0, 173, 181, .8);
}
.field input.invalid,
.field textarea.invalid { border-color: #D9636D; }

.field-error {
  display: none;
  margin-block-start: .5rem;
  font-size: .8125rem;
  color: #E38A91;
}
.field-error.show { display: block; }

#form-status.status-success {
  background: rgba(0, 173, 181, .1);
  color: var(--brand-light);
  border: 1px solid rgba(0, 173, 181, .3);
}
#form-status.status-error {
  background: rgba(217, 99, 109, .1);
  color: #E38A91;
  border: 1px solid rgba(217, 99, 109, .3);
}

/* ============================================================== reveals */
/* Sections start invisible and main.js adds .in as they scroll into view.
   That means a single failure in main.js - a JS error, a blocked or truncated
   download - leaves the whole page blank rather than merely unanimated. So the
   hiding is applied only once JS has proved it is running (html.js-on, set by
   the inline script in index.html), and .reveal-failsafe un-hides everything
   if main.js has not reported in a few seconds later. */
.reveal {
  transition: opacity .85s var(--ease-out) var(--d, 0ms),
              transform .85s var(--ease-out) var(--d, 0ms);
  will-change: opacity, transform;
}
.js-on .reveal {
  opacity: 0;
  transform: translateY(26px);
}
.reveal.in,
.reveal-failsafe .reveal { opacity: 1; transform: none; }

/* Cards are both the reveal target and the tilt target. The generic .reveal
   transform transition (850ms) would make tilt feel sluggish, so cards get a
   short transform transition while keeping the slow opacity fade. */
.reveal.svc {
  transition: opacity .85s var(--ease-out) var(--d, 0ms),
              transform .38s var(--ease),
              border-color .4s var(--ease),
              background-color .4s var(--ease),
              box-shadow .4s var(--ease);
}

/* ====================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  /* .js-on .reveal outranks a bare .reveal, so this has to match it. */
  .reveal, .js-on .reveal { opacity: 1; transform: none; }
  .svc li { opacity: 1; transform: none; }
  .grain, .aura { display: none; }
  #cursor-dot, #cursor-ring { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: auto; }
}

/* ==================================================== section PC accents */
/* A gaming PC drifts beside each section as you scroll. Decorative only —
   hidden on narrow screens and for reduced-motion visitors. */
.section-pc {
  position: absolute;
  inset-block-start: 50%;
  width: clamp(240px, 24vw, 380px);
  height: auto;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  filter: saturate(1.25) brightness(1.12) contrast(1.02);
  transform: translate3d(0, -50%, 0);
  transition: opacity 1.4s var(--ease-out);
}
.section-pc-start { inset-inline-start: -14%; }
.section-pc-end   { inset-inline-end: -14%; }

/* fades in once its section is on screen, and back out when it leaves */
.section-pc.lit { opacity: .5; }

/* ---- the same machines, on a phone --------------------------------------
   A phone has no column to spare beside the text, so the machines move behind
   it instead of next to it: smaller, bled further off the edge, and dimmed far
   enough to read as texture rather than as a picture competing with the copy.
   Everything else is kept — the same photos, the same alternating left/right
   rhythm down the page, the same scroll drift, the same teal glow — so it
   still reads as the desktop site rather than a stripped-down version of it. */
@media (max-width: 1023px) {
  .section-pc {
    display: block;
    width: clamp(170px, 54vw, 290px);
    inset-block-start: 38%;
    /* a touch of blur pushes them behind the text rather than beside it */
    filter: saturate(1.15) brightness(1.06) contrast(1.02) blur(1px);
  }
  /* bled further off-screen than on desktop: only the near half of the machine
     shows, which keeps the text column clear on a narrow screen */
  .section-pc-start { inset-inline-start: -26%; }
  .section-pc-end   { inset-inline-end: -26%; }
  .section-pc.lit   { opacity: .2; }

  /* The hero machine stops being a grid column and becomes the backdrop of the
     headline, keeping the glow that frames it on desktop. */
  .hero-art {
    position: absolute;
    /* clear of the fixed header, sitting behind the headline and the buttons */
    inset-block-start: 12%;
    inset-inline-end: -20%;
    width: 68vw;
    max-width: 340px;
    z-index: 0;
    pointer-events: none;
  }
  /* The fade lives on the image, not on .hero-art — .reveal animates the
     wrapper's opacity from 0 to 1, and dimming it there would be overwritten. */
  .hero-art img {
    opacity: .2;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .5)) blur(.5px);
  }
  .hero-art::before {
    width: 130%;
    filter: blur(44px);
  }
}

/* Below ~380px even the bled-off machines crowd the text, so they step back
   further still rather than disappearing. */
@media (max-width: 380px) {
  .section-pc.lit { opacity: .14; }
  .hero-art { inset-inline-end: -28%; }
  .hero-art img { opacity: .15; }
}

/* soft glow behind the hero machine */
.hero-art {
  position: relative;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 118%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 173, 181, .16), transparent 62%);
  filter: blur(30px);
  z-index: -1;
}
.hero-art img {
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55));
}

@media (prefers-reduced-motion: reduce) {
  .section-pc { transition: none; }
}
