/* ==========================================================================
   Obaida HajMustafa — Portfolio
   Base system: editorial + minimal, taken from the 2026 infographic.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Colour (sampled from the infographic) */
  --paper: #dbd6cd;
  --cream: #f1ece4;
  --ink: #231f20;
  --night: #050609;
  --red: #ba3b2d;        /* accent: large text, lines, fills */
  --red-text: #9e2f23;   /* red for text under 24px (5:1 on paper) */
  --green: #4c6751;
  --grey: #59595c;       /* lightest grey allowed for text on paper */
  --line: rgba(35, 31, 32, 0.55);
  --line-soft: rgba(35, 31, 32, 0.18);

  /* Type */
  --f-display: "Archivo Black", "Arial Black", sans-serif;
  --f-poster: "Anton", "Impact", sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --f-script: "Sacramento", cursive;
  --f-jp: "Noto Sans JP", sans-serif;

  /* Layout */
  --wrap: 1320px;
  --gutter: clamp(20px, 3.4vw, 60px);
  --bar-h: 56px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain: one fixed layer over everything, never catches the pointer */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.14 0 0 0 0 0.12 0 0 0 0 0.12 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--red); color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--f-mono);
  font-size: 13px;
}
.skip:focus { top: 10px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Small parts ---------- */
.label {
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.label--red { color: var(--red-text); }
.jp {
  font-family: var(--f-jp);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--red-text);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: var(--red-text);
}

/* Buttons: one pair for the whole site */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 24px 0 26px;
  border: 1.5px solid var(--ink);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-display);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn__arrow {
  display: inline-block;
  width: 18px;
  height: 18px;
  overflow: hidden;
  position: relative;
}
.btn__arrow svg {
  position: absolute;
  inset: 0;
  transition: transform 0.45s var(--ease);
}
.btn__arrow svg + svg { transform: translateX(-130%); }
.btn:hover { --btn-bg: var(--red); border-color: var(--red); transform: translateY(-2px); }
.btn:hover .btn__arrow svg { transform: translateX(130%); }
.btn:hover .btn__arrow svg + svg { transform: translateX(0); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); }
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--cream); border-color: var(--ink); }

/* Text link with an underline that draws */
.link {
  position: relative;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease), color 0.25s var(--ease);
}
.link:hover { background-size: 100% 1px; color: var(--red-text); }

/* ==========================================================================
   Top bar
   ========================================================================== */
.bar {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}
.bar__in {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--bar-h);
}
.bar__name {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.bar__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  transition: transform 0.4s var(--ease);
}
.bar__name:hover .bar__dot { transform: scale(1.6); }
.bar__rule {
  flex: 1 1 40px;
  height: 1px;
  background: var(--line);
  min-width: 24px;
}
.bar__nav { display: flex; gap: clamp(16px, 2.2vw, 34px); }
.bar__nav a { display: inline-flex; align-items: center; height: var(--bar-h); }
.bar__nav .num { color: var(--red-text); margin-right: 7px; }
.bar__jp { white-space: nowrap; font-size: 12px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.hero__stage-wrap { flex: 1 1 auto; display: flex; }
.hero__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
}

/* Giant outline word behind everything */
.hero__ghost {
  position: absolute;
  left: -1.5%;
  right: -1.5%;
  top: clamp(56px, 9.5vh, 96px);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.hero__ghost svg { width: 100%; height: auto; overflow: visible; }
.hero__ghost text {
  font-family: var(--f-display);
  font-size: 200px;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.hero__file {
  position: absolute;
  left: 0;
  top: 22px;
  z-index: 3;
}

/* Portrait: cut-out with its own slanted frame, standing on the baseline rule */
.hero__portrait {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 38.5%;
  height: min(96%, 760px);
  aspect-ratio: 588 / 724;
}
.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: contrast(1.04) saturate(0.92);
}

/* Copy block */
.hero__copy {
  position: relative;
  z-index: 2;
  width: min(100%, 470px);
  padding-bottom: clamp(28px, 4.5vh, 48px);
}
.hero__title {
  font-family: var(--f-poster);
  font-weight: 400;
  font-size: clamp(76px, 9.3vw, 136px);
  line-height: 0.88;
  letter-spacing: -0.005em;
  color: var(--night);
}
.hero__title span { display: block; }
.hero__tag {
  margin-top: 16px;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  color: var(--red-text);
}
.hero__intro {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 17px;
  line-height: 1.55;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.hero__sign {
  display: inline-block;
  margin-top: 14px;
  padding: 0 10px 0 2px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-script);
  font-size: 58px;
  line-height: 1.15;
}

/* Style index: the speech-bubble card from the infographic, now listing the styles */
.styles-card {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: clamp(40px, 7vh, 72px);
  width: 244px;
  padding: 18px 20px 20px;
  border: 1.5px solid var(--red);
  border-radius: 16px 16px 0 16px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(3px);
}
.styles-card::after {
  content: "";
  position: absolute;
  right: -1.5px;
  bottom: -15px;
  width: 22px;
  height: 15px;
  background: linear-gradient(to top right, transparent calc(50% - 1px), var(--red) calc(50% - 1px), var(--red) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  border-right: 1.5px solid var(--red);
}
.styles-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.styles-card__lede {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 14px;
}
.styles-card__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}
.styles-card__list li {
  display: flex;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.styles-card__list .num { color: var(--red-text); }
.styles-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--red-text);
}
.styles-card__more svg { transition: transform 0.4s var(--ease); }
.styles-card__more:hover svg { transform: translateY(3px); }

/* Baseline strip */
.hero__strip { border-top: 1px solid var(--ink); position: relative; z-index: 3; background: var(--paper); }
.hero__strip-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 52px;
}
.hero__status { display: inline-flex; align-items: center; gap: 10px; }
.hero__status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(76, 103, 81, 0.5);
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 103, 81, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(76, 103, 81, 0); }
}
.hero__scroll { display: inline-flex; align-items: center; gap: 10px; }
.hero__scroll svg { animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

/* ==========================================================================
   Smaller screens (full phone and tablet pass comes in step 7)
   ========================================================================== */
@media (max-width: 1100px) {
  .bar__rule--2, .bar__jp { display: none; }
  .hero__portrait { left: 44%; }
  .styles-card { display: none; }
}

@media (max-width: 820px) {
  .bar__nav .num { display: none; }
  .hero__stage { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero__copy { width: 100%; padding-top: 76px; padding-bottom: 8px; }
  .hero__portrait {
    position: relative;
    left: auto;
    align-self: center;
    height: auto;
    width: min(86%, 420px);
    margin-top: 4px;
  }
  .hero__ghost { top: 64px; }
  .hero__strip-in .hero__place { display: none; }
}

@media (max-width: 520px) {
  .bar__rule { display: none; }
  .bar__in { justify-content: space-between; }
  .bar__nav { gap: 14px; }
  .bar__nav a:nth-child(2) { display: none; }
  .btn { flex: 1 1 100%; justify-content: space-between; }
}

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