/* uriziv.co.il main stylesheet. RTL-first: logical properties only.
   All text colors meet WCAG AA (4.5:1) against their background, in both themes. */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --heading: #312e81;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #4338ca;
  --focus: #c2410c;

  /* Header and footer (dark band in both themes) */
  --band-bg: #1e1b4b;
  --band-text: #e0e7ff;
  --band-muted: #c7d2fe;
  --band-focus: #fbbf24;

  /* Card stripes (decorative) */
  --c1: #4f46e5;
  --c2: #0d9488;
  --c3: #e11d48;
  --c4: #d97706;

  --notice-bg: #fef3c7;
  --notice-text: #78350f;
  --badge-bg: #fef3c7;
  --badge-text: #92400e;

  /* Home page: the glow and shadow around the icon */
  --glow-1: rgb(14 165 233 / 0.3);
  --glow-2: rgb(79 70 229 / 0.25);
  --logo-shadow: 0 12px 32px rgb(30 27 75 / 0.22), 0 0 0 1px rgb(30 27 75 / 0.06);

  --radius: 0.75rem;
  --shadow: 0 1px 3px rgb(15 23 42 / 0.08), 0 4px 12px rgb(15 23 42 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #1e293b;
    --text: #e2e8f0;
    --heading: #c7d2fe;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #a5b4fc;
    --focus: #fbbf24;

    --band-bg: #020617;

    --c1: #818cf8;
    --c2: #2dd4bf;
    --c3: #fb7185;
    --c4: #fbbf24;

    --notice-bg: #422006;
    --notice-text: #fde68a;
    --badge-bg: #422006;
    --badge-text: #fde68a;

    --glow-1: rgb(14 165 233 / 0.35);
    --glow-2: rgb(129 140 248 / 0.3);
    --logo-shadow: 0 12px 32px rgb(0 0 0 / 0.5);

    --shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  }
}

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

html {
  font-size: 100%;
  /* Keep in-page jumps and keyboard focus clear of the sticky header */
  scroll-padding-block: 6rem 1rem;
}

body {
  margin: 0;
  min-block-size: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
  line-height: 1.6;
}

.container {
  inline-size: 100%;
  max-inline-size: 60rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

main {
  flex: 1;
  padding-block: 2rem;
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--heading);
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

/* Skip link: hidden until focused */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -10rem;
  padding: 0.5rem 1rem;
  background: var(--band-focus);
  color: #1e1b4b;
  font-weight: 700;
  z-index: 10;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* Header and footer: dark band */
.site-header,
.site-footer {
  --focus: var(--band-focus);
  background: var(--band-bg);
  color: var(--band-text);
}

/* The header stays on screen while scrolling (the footer does not) */
.site-header {
  position: sticky;
  z-index: 5;
  inset-block-start: 0;
  border-block-end: 4px solid transparent;
  border-image: linear-gradient(to left, var(--c1), var(--c2), var(--c3), var(--c4)) 1;
}

.header-inner {
  padding-block: 0.6rem;
}

/* Header row: hamburger at the start (right), icon in the center.
   Three columns, the outer two equal, so the icon is truly centered. */
.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-home {
  grid-column: 2;
  display: flex;
  border-radius: 0.4rem;
}

/* Hamburger menu */
.menu {
  position: relative;
  grid-column: 1;
  justify-self: start;
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  list-style: none;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-button:hover {
  background: rgb(255 255 255 / 0.1);
}

/* Three bars, drawn with CSS; they turn into an X when the menu is open */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  inline-size: 1.4rem;
  block-size: 2px;
  border-radius: 1px;
  background: var(--band-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
}

.menu-icon::before {
  transform: translateY(-0.45rem);
}

.menu-icon::after {
  transform: translateY(0.45rem);
}

.menu[open] .menu-icon {
  background: transparent;
}

.menu[open] .menu-icon::before {
  transform: rotate(45deg);
}

.menu[open] .menu-icon::after {
  transform: rotate(-45deg);
}

.menu-list {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(100% + 1.15rem); /* just below the header's color line */
  min-inline-size: 12rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--band-bg);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.3);
}

.menu-list a {
  display: block;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  color: var(--band-text);
  text-decoration: none;
}

/* Home link: small icon before the text */
.menu-list .menu-home {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-home img {
  border-radius: 0.25rem;
}

.menu-list a:hover {
  background: rgb(255 255 255 / 0.1);
}

.menu-list a[aria-current="page"] {
  font-weight: 700;
  background: rgb(255 255 255 / 0.08);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer {
  padding-block: 0.6rem;
  text-align: center;
  color: var(--band-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin-block: 0.25rem 0;
}

.ai-notice {
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--band-text);
}

/* Home page: welcome section */
.welcome {
  max-inline-size: 40rem;
  margin-inline: auto;
  padding-block: 1.5rem 0.5rem;
  text-align: center;
  isolation: isolate;
  overflow-x: clip; /* keep the glow from widening the page on phones */
}

/* The icon, with a soft two-color glow behind it (decorative) */
.welcome-logo {
  position: relative;
  display: inline-block;
  margin-block-end: 1.5rem;
}

.welcome-logo::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(circle closest-side at 38% 42%, var(--glow-1), transparent),
    radial-gradient(circle closest-side at 62% 58%, var(--glow-2), transparent);
}

.welcome-logo img {
  position: relative; /* above the glow */
  display: block;
  inline-size: clamp(8rem, 32vw, 11rem);
  block-size: auto;
  border-radius: 18.75%; /* matches the icon's own corners (6/32) */
  box-shadow: var(--logo-shadow);
  animation: welcome-pop 0.6s ease-out both;
}

@keyframes welcome-pop {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.95);
  }
}

.welcome h1 {
  margin-block: 0 1rem;
  font-size: clamp(2rem, 7vw, 2.75rem);
}

.welcome-text {
  margin-block: 0 1.75rem;
  color: var(--muted);
}

.welcome-signoff {
  margin-block: 2rem 0;
  text-align: center;
  color: var(--heading);
  font-weight: 700;
}

.lead {
  font-size: 1.15rem;
}

/* Home page: projects, one under the other */
.projects {
  max-inline-size: 40rem;
  margin: 2.5rem auto 0;
}

.projects h2 {
  margin-block: 0 1rem;
  font-size: 1.35rem;
  text-align: center;
}

.project-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  --stripe: var(--c1);
  position: relative;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--stripe);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.15s ease;
}

.project:nth-child(4n + 2) {
  --stripe: var(--c2);
}

.project:nth-child(4n + 3) {
  --stripe: var(--c3);
}

.project:nth-child(4n + 4) {
  --stripe: var(--c4);
}

.project h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0 0.25rem;
  font-size: 1.15rem;
}

.project a {
  text-decoration: none;
}

/* The whole card is clickable (the link stretches over it) */
.project a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.project:has(a):hover {
  transform: translateY(-2px);
}

.project:has(a:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.project a:focus-visible {
  outline: none;
}

.project p {
  margin: 0;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--badge-bg);
  color: var(--badge-text);
}

/* Misc */
.muted {
  color: var(--muted);
}

.notice {
  padding: 0.75rem 1rem;
  background: var(--notice-bg);
  color: var(--notice-text);
  border-inline-start: 5px solid var(--c4);
  border-radius: var(--radius);
}

.centered {
  text-align: center;
}

/* Arrow after links that open in a new tab */
.new-tab {
  display: inline-block;
  margin-inline-start: 0.2em;
  font-size: 0.8em;
  text-decoration: none;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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