/* ==========================================================================
   Aryan Ashraf — Portfolio
   Plain CSS, no frameworks. White + orange, warm and handcrafted.
   Organized by section:
     1. Font & custom properties
     2. Reset & base
     3. Utilities (skip link, visually-hidden, container, buttons)
     4. Header & navigation
     5. Hero (+ entrance animation, squiggle, scroll hint)
     6. Marquee strip
     7. Sections & cards
     8. Skills
     9. Footer / contact (inverted panel)
    10. Scroll-reveal (JS-enhanced)
    11. Reduced motion
   Verified WCAG 2.1 AA ratios (on white): ink 18.0 · muted 6.4 ·
   link orange #c2410c 5.2 · deep #9a3412 7.3. On dark footer #201409:
   cream 17.0 · orange #f97316 6.4. #ea580c (3.56) is used only for large
   text and non-text UI; #f97316 on white is decorative only.
   ========================================================================== */

/* 1. Font & custom properties ---------------------------------------------- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/BricolageGrotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Palette */
  --color-bg: #ffffff;
  --color-bg-warm: #fff7f0;         /* alternating section tint */
  --color-peach: #ffedd5;           /* badges, soft fills */
  --color-ink: #1f1508;             /* body text */
  --color-muted: #6b5d4f;
  --color-orange: #c2410c;          /* interactive: links, buttons (5.2:1) */
  --color-orange-deep: #9a3412;     /* hover, emphasis (7.3:1) */
  --color-orange-bright: #ea580c;   /* large text / UI graphics (3.56:1) */
  --color-orange-pop: #f97316;      /* decorative only */
  --color-border: #f0e0d0;
  --color-footer-bg: #201409;
  --color-footer-text: #fff7f0;
  --color-footer-muted: #d4c3b5;
  --color-footer-link: #fb923c;

  /* Type */
  --font-body: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-body);
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: clamp(1.3rem, 1.15rem + 0.8vw, 1.6rem);
  --text-xl: clamp(1.7rem, 1.35rem + 1.7vw, 2.4rem);
  --text-2xl: clamp(2.6rem, 1.7rem + 4.5vw, 4.4rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3.25rem;
  --space-8: 5rem;

  --radius: 0.75rem;
  --content-width: 47rem;
  --header-height: 3.75rem;
  --shadow-card: 0 1px 2px rgba(31, 21, 8, 0.04);
  --shadow-lift: 0 14px 34px rgba(234, 88, 12, 0.14), 0 3px 8px rgba(31, 21, 8, 0.06);
}

/* 2. Reset & base ----------------------------------------------------------- */

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

/* Author display rules below must never resurrect [hidden] elements
   (e.g. the nav toggle before JS un-hides it). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--text-2xl); font-weight: 750; }
h2 { font-size: var(--text-xl); font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 650; }

/* A little punctuation personality on section headings (decorative) */
.section h2::after {
  content: ".";
  color: var(--color-orange-bright);
}

p, ul {
  margin: 0 0 var(--space-4);
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: var(--space-2);
}

a {
  color: var(--color-orange);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-orange-deep);
  text-decoration-thickness: 2px;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-peach);
  padding: 0.1em 0.35em;
  border-radius: 0.25em;
}

::selection {
  background-color: var(--color-peach);
  color: var(--color-orange-deep);
}

/* 3. Utilities --------------------------------------------------------------- */

.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-orange);
  color: #ffffff;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--color-orange);
  border-radius: 999px;
  color: var(--color-orange);
  background-color: transparent;
  font-weight: 650;
  font-family: var(--font-display);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease,
              border-color 160ms ease, transform 160ms ease,
              box-shadow 160ms ease;
}

.button:hover {
  background-color: var(--color-peach);
  color: var(--color-orange-deep);
  transform: translateY(-2px);
}

.button--primary {
  background-color: var(--color-orange);
  color: #ffffff;
}

.button--primary:hover {
  background-color: var(--color-orange-deep);
  color: #ffffff;
  border-color: var(--color-orange-deep);
  box-shadow: var(--shadow-lift);
}

/* Soft light sweep across the primary button on hover (decorative) */
.button--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%,
              rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-110%);
}

.button--primary:hover::after {
  transition: transform 550ms ease;
  transform: translateX(110%);
}

/* 4. Header & navigation -------------------------------------------------------
   Without JS: toggle stays [hidden], nav list always visible (wraps).
   With JS (<html class="js">): collapses below 720px behind the button. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  max-width: 68rem;
  margin-inline: auto;
  padding: var(--space-2) var(--space-4);
  min-height: var(--header-height);
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: var(--text-md);
  color: var(--color-ink);
  text-decoration: none;
  padding: var(--space-2) 0;
}

.site-header__brand:hover {
  color: var(--color-orange);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list li {
  margin: 0;
}

/* Sliding underline, drawn with a background gradient */
.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(var(--color-orange-bright), var(--color-orange-bright));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left calc(100% - 8px);
  transition: background-size 220ms ease, color 160ms ease;
}

.site-nav__list a:hover,
.site-nav__list a.is-active {
  color: var(--color-orange-deep);
  background-size: calc(100% - 2 * var(--space-3)) 2px;
  background-position: var(--space-3) calc(100% - 8px);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-weight: 650;
  color: var(--color-ink);
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--color-orange);
  color: var(--color-orange-deep);
}

.nav-toggle__bars {
  display: inline-block;
  width: 1.1em;
  height: 0.8em;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.nav-toggle__bars::before {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  left: 0;
  right: 0;
  border-top: 2px solid currentColor;
}

@media (max-width: 719.98px) {
  html.js .site-nav {
    flex-basis: 100%;
  }

  html.js .site-nav[data-collapsed] {
    display: none;
  }

  html.js .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    padding-block: var(--space-2);
  }
}

@media (min-width: 720px) {
  html.js .nav-toggle {
    display: none;
  }
}

/* 5. Hero ------------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-8) var(--space-8);
  /* soft peach glow + faint dot grid, both decorative */
  background:
    radial-gradient(38rem 24rem at 85% -10%, var(--color-peach), transparent 70%),
    radial-gradient(rgba(249, 115, 22, 0.16) 1px, transparent 1.5px) 0 0 / 26px 26px,
    var(--color-bg);
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-orange);
  margin-bottom: var(--space-3);
}

.hero__kicker::before {
  content: "✳ ";
  color: var(--color-orange-pop);
}

.hero h1 {
  margin-bottom: var(--space-2);
}

/* Last name picks up an orange gradient (large display text, ≥3:1) */
.hero__accent {
  background: linear-gradient(92deg, var(--color-orange-deep), var(--color-orange-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--color-orange-deep);
  -webkit-text-fill-color: transparent;
}

/* Hand-drawn squiggle under the name */
.hero__squiggle {
  display: block;
  width: min(16rem, 55%);
  height: auto;
  margin-bottom: var(--space-5);
  color: var(--color-orange-pop);
}

.hero__lede {
  font-size: var(--text-md);
  color: var(--color-muted);
  max-width: 62ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
}

.hero__actions li {
  margin: 0;
}

.hero__scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--space-3);
  translate: -50% 0;
  color: var(--color-orange-bright);
  font-size: 1.4rem;
  line-height: 1;
}

/* Staggered entrance — CSS only, ends fully visible, disabled by §11 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .hero__kicker   { animation: rise-in 600ms 60ms ease-out both; }
  .hero h1        { animation: rise-in 600ms 140ms ease-out both; }
  .hero__squiggle { animation: rise-in 600ms 220ms ease-out both; }
  .hero__lede     { animation: rise-in 600ms 300ms ease-out both; }
  .hero__actions  { animation: rise-in 600ms 380ms ease-out both; }

  @keyframes hint-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
  }

  .hero__scroll-hint {
    animation: hint-bounce 1.6s ease-in-out 5;
  }
}

/* 6. Marquee strip -----------------------------------------------------------------
   Decorative (aria-hidden). Content is duplicated in the HTML so the
   -50% translation loops seamlessly. Static row when motion is reduced. */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--color-border);
  background-color: var(--color-bg-warm);
  padding-block: var(--space-3);
}

.marquee__track {
  display: flex;
  gap: var(--space-6);
  width: max-content;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-orange-deep);
  white-space: nowrap;
}

.marquee__track span {
  display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes marquee-scroll {
    to { transform: translateX(-50%); }
  }

  .marquee__track {
    animation: marquee-scroll 36s linear infinite;
  }

  .marquee:hover .marquee__track {
    animation-play-state: paused;
  }
}

/* 7. Sections & cards ------------------------------------------------------------- */

.section {
  padding-block: var(--space-8);
}

/* Alternate warm tint for gentle rhythm */
.section:nth-of-type(odd) {
  background-color: var(--color-bg-warm);
}

.section__num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-orange);
}

.section__intro {
  font-size: var(--text-md);
  max-width: 62ch;
}

.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.card:hover {
  transform: translateY(-4px) rotate(-0.3deg);
  border-color: var(--color-orange-bright);
  box-shadow: var(--shadow-lift);
}

.card:last-child {
  margin-bottom: 0;
}

.card--featured {
  border: 2px solid var(--color-orange-bright);
  background: linear-gradient(160deg, var(--color-bg) 55%, var(--color-peach));
}

.card__header {
  margin-bottom: var(--space-4);
}

.card__header h3 {
  margin-bottom: var(--space-1);
}

.card__meta {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.card__tags {
  font-family: var(--font-mono);
  color: var(--color-muted);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

.card__links {
  margin-bottom: 0;
  font-weight: 650;
}

.card > ul:last-child,
.card > p:last-child {
  margin-bottom: 0;
}

.badge {
  display: inline-block;
  padding: 0.15em 0.7em;
  margin-right: var(--space-2);
  border-radius: 999px;
  background-color: var(--color-orange);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-sm);
}

.card-grid {
  display: grid;
  gap: var(--space-5);
}

.card-grid .card {
  margin-bottom: 0;
}

/* 8. Skills ---------------------------------------------------------------------- */

.skills-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 540px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.skills-group h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.pill-list li {
  margin: 0;
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--text-sm);
  transition: border-color 150ms ease, background-color 150ms ease,
              transform 150ms ease;
}

.pill-list li:hover {
  border-color: var(--color-orange-bright);
  background-color: var(--color-peach);
  transform: rotate(-1.5deg) scale(1.04);
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list > li {
  margin-bottom: var(--space-5);
}

.plain-list h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

/* 9. Footer / contact — inverted panel --------------------------------------------- */

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding-block: var(--space-8) var(--space-6);
}

.site-footer h2 {
  font-size: var(--text-xl);
}

.site-footer h2::after {
  content: ".";
  color: var(--color-orange-pop);
}

.site-footer p {
  color: var(--color-footer-muted);
  max-width: 62ch;
}

.site-footer a {
  color: var(--color-footer-link);
}

.site-footer a:hover {
  color: var(--color-footer-text);
}

.site-footer :focus-visible {
  outline-color: var(--color-footer-link);
}

/* The email is the star of the footer */
.contact-list {
  list-style: none;
  margin: var(--space-5) 0 var(--space-7);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}

.contact-list li {
  margin: 0;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
}

.contact-list li:first-child {
  flex-basis: 100%;
}

.contact-list li:first-child a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.site-footer__fineprint {
  color: var(--color-footer-muted);
  font-size: var(--text-sm);
  border-top: 1px solid rgba(255, 247, 240, 0.15);
  padding-top: var(--space-5);
  margin-bottom: 0;
}

/* 10. Scroll-reveal (added by JS; initial hidden state only applies when both
   JS is running and the user allows motion, so nothing can get stuck hidden) */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 550ms ease, transform 550ms ease;
  }

  html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* 11. Reduced motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
