/*
  style.css — how the page LOOKS.
  Each rule is: a SELECTOR (which elements) { PROPERTY: value; }.
*/

/* Custom properties: colours named once, used everywhere with var(--name).
   Change a colour here and the whole page follows. */
:root {
  --bg: #08070b;          /* near-black, like $IMI's own windows */
  --text: #e9e6f0;
  --muted: #9a94a8;
  --accent: #b44dff;      /* purple; placeholder until Ethan picks the exact one */
  --glow: rgba(180, 77, 255, 0.55);
  /* The same promise as the <meta name="color-scheme"> in index.html: this page is already dark. */
  color-scheme: dark;
}

/* box-sizing: border-box makes an element's width include its padding and border,
   which is how most people expect the box model to work. */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* System fonts: already on the visitor's device, so nothing is fetched from another site. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;    /* rem = relative to the browser's base size (usually 16px) */
  line-height: 1.6;
}

/* ---------- The top section ---------- */

.hero {
  min-height: 100vh;      /* vh = viewport height: fill the screen */
  display: flex;          /* flexbox stacks the eye, lettering and line... */
  flex-direction: column;
  align-items: center;    /* ...centred side to side */
  justify-content: center;/* ...and top to bottom */
  gap: 1.5rem;
  padding: 3rem 1rem;
  text-align: center;
  /* Two backgrounds layered: a fade to the page colour on top, the smoke underneath. */
  background:
    linear-gradient(to bottom, rgba(8, 7, 11, 0.35), var(--bg) 95%),
    url("images/smoke.webp") center / cover no-repeat;
}

/* The eye: a box filled with a colour, cut to the eye's shape by a mask.
   The SVG is the stencil; background-color is the paint. */
.eye {
  width: min(45vw, 220px);         /* whichever is smaller: 45% of the screen or 220px */
  aspect-ratio: 832.35 / 978;      /* the SVG's own proportions, from its viewBox */
  background-color: var(--text);
  -webkit-mask: url("images/eye.svg") center / contain no-repeat;
          mask: url("images/eye.svg") center / contain no-repeat;
  /* The glow: a soft purple shadow that follows the shape. */
  filter: drop-shadow(0 0 18px var(--glow)) drop-shadow(0 0 4px var(--glow));

  /* Two animations at once, separated by commas; each property below lists one value per animation.
     1. pulse: the glow breathes, on a clock (5 seconds, forever).
     2. fade-away: the eye fades and shrinks as the page scrolls. */
  animation: pulse 5s ease-in-out infinite, fade-away linear both;
  /* These must come after "animation", because that shorthand resets them. */
  animation-timeline: auto, scroll();  /* auto = the clock; scroll() = the page's scroll position */
  animation-range: normal, 0 60vh;     /* the fade is complete after scrolling 60% of a screen */
}

/* The pulse: keyframes are the steps of the animation, like keyframes on a timeline. */
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 18px var(--glow)) drop-shadow(0 0 4px var(--glow)); }
  50%      { filter: drop-shadow(0 0 34px var(--glow)) drop-shadow(0 0 8px var(--glow)); }
}

/* The scroll fade: from how it looks now to faded out and slightly smaller. */
@keyframes fade-away {
  to { opacity: 0; transform: scale(0.9); }
}

/* Visitors who set their device to reduce motion get the eye standing still, glow and all. */
@media (prefers-reduced-motion: reduce) {
  .eye { animation: none; }
}

h1 { margin: 0; }

.wordmark {
  display: block;
  width: min(48vw, 240px);       /* was min(60vw, 300px); both numbers 20% smaller */
  /* The lettering file is black; invert(1) flips it to white for the dark page. */
  filter: invert(1) drop-shadow(0 0 10px var(--glow));
}

.tagline {
  margin: 0;
  max-width: 28ch;        /* ch = width of one character: keeps the line short */
  font-size: 1.25rem;
  color: var(--muted);
}

/* ---------- The text sections ---------- */

main {
  max-width: 38rem;       /* a comfortable reading width */
  margin: 0 auto;         /* auto side margins centre the column */
  padding: 0 1rem 4rem;
}

section { margin-top: 3rem; }

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

p { margin: 0; }

code {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--text);
}

/* The note for services stands apart: a thin purple border on the left. */
.notice {
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

/* ---------- Contrast themes ----------
   Some visitors turn on a high-contrast theme (Windows calls it a "contrast theme").
   The browser then swaps the page's colours for the theme's own. That's good for text,
   but it would paint the eye in the background colour and hide it. This media query
   applies only while such a theme is on; it paints the eye in the theme's text colour. */
@media (forced-colors: active) {
  .eye {
    forced-color-adjust: none;
    background-color: CanvasText;  /* a system colour: whatever text colour the theme uses */
    filter: none;
    animation-name: none, fade-away;  /* no glow to pulse in this mode; keep the scroll fade */
  }
}

footer {
  padding: 2rem 1rem 3rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
