/* ----------------------------------------------------------------------
   Joseph Eid — "On the cutting table" (coming soon)
   The page is a length of navy suiting on the tailor's bench: a jacket
   pattern chalked onto the cloth, and the workshop ticket for the order
   "josepheid.com", hanging beside it.
   Change a value here and it changes everywhere.
   ---------------------------------------------------------------------- */
:root {
  --navy:      #0C1A3B;   /* the cloth */
  --navy-deep: #07102A;   /* shadows at the edge of the bench */
  --stripe:    rgba(236, 231, 219, .045);  /* pinstripe */
  --chalk:     #ECE7DB;   /* tailor's chalk */
  --chalk-dim: rgba(236, 231, 219, .45);
  --cream:     #F5F0E8;   /* text on cloth */
  --cream-2:   rgba(245, 240, 232, .76);
  --cream-3:   rgba(245, 240, 232, .52);
  --line:      rgba(245, 240, 232, .14);

  --paper:     #F3EDE0;   /* the ticket */
  --paper-rule:#E2D9C7;
  --ink:       #15204A;   /* navy ink on the ticket */
  --ink-2:     #5A5F74;
  --rust:      #A5452C;   /* the rubber stamp */
  --thread:    #C9B99A;

  --serif:  "Cormorant Garamond", Georgia, serif;
  --sans:   "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:   "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --hand:   "Caveat", "Segoe Print", cursive;
  --arabic: "Noto Naskh Arabic", serif;

  --gutter: clamp(18px, 4vw, 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { overflow-x: clip; }   /* the rotated ticket and chalk marks may poke past the edge */
body {
  background-color: var(--navy);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---- the cloth: pinstripe + twill + a vignette ---- */
.cloth {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 85% 75% at 45% 40%, transparent 40%, var(--navy-deep) 100%),
    repeating-linear-gradient(90deg, transparent 0 46px, var(--stripe) 46px 47px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 5px),
    var(--navy);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px var(--gutter) 24px;
}

.label {
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--cream-3);
}
.arabic { font-family: var(--arabic); font-size: 15px; letter-spacing: 0; text-transform: none; }

/* ---- top ---- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* logo sits dead centre */
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: block; }
.sig { display: block; height: 30px; width: auto; }
.top-right { justify-self: end; }

/* ---- headline ---- */
.intro { max-width: 560px; }
.headline {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(52px, 7.4vw, 108px);
  line-height: .92;
  letter-spacing: -.025em;
}
.headline em { font-style: italic; color: var(--chalk); }
.lede {
  max-width: 34em;
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--cream-2);
}

/* ---- the bench ---- */
.bench {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  min-height: calc(100svh - 190px);
  padding-block: clamp(28px, 4vw, 48px) clamp(48px, 6vw, 72px);
}
/* the chalked pattern, and the ticket hanging beside it */
.right {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

/* chalk pattern */
.pattern { margin: 0; color: var(--chalk); }
.pattern svg { display: block; width: 100%; max-width: 400px; max-height: 72svh; height: auto; margin-inline: auto; overflow: visible; }
.chalk path, .chalk circle { fill: none; stroke: var(--chalk); stroke-linecap: round; stroke-linejoin: round; }
.chalk .draw { stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: chalk-draw 1.6s ease-in-out forwards; }
.chalk .allow { stroke: var(--chalk-dim); stroke-width: 1.2; stroke-dasharray: 6 7; opacity: 0; animation: fade .8s 2.6s ease-out forwards; }
.chalk .grain { stroke-width: 1.4; }
.chalk .dim { stroke: var(--chalk-dim); stroke-width: 1.1; }
.chalk .draw-fade { stroke-width: 1.8; opacity: 0; animation: fade .6s ease-out forwards; }
.d1 { animation-delay: .2s !important; animation-duration: 2.4s !important; }
.d2 { animation-delay: 2.2s !important; }
.d3 { animation-delay: 2.5s !important; animation-duration: .9s !important; }
.d4 { animation-delay: 2.9s !important; animation-duration: .6s !important; }
.d5 { animation-delay: 3.1s !important; animation-duration: .8s !important; }
.f1 { animation-delay: 3.3s !important; }
.f2 { animation-delay: 3.6s !important; }

.scrawl text {
  font-family: var(--hand);
  font-size: 20px;
  fill: var(--chalk);
  opacity: 0;
  animation: fade .8s 3.8s ease-out forwards;
}
.scrawl .small { font-size: 16px; fill: var(--chalk-dim); }

/* workshop ticket */
.ticket {
  position: relative;
  justify-self: center;
  width: min(100%, 340px);
  padding: 34px 26px 24px;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(255,255,255,.5), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  transform: rotate(-2.2deg);
  box-shadow:
    0 1px 0 rgba(0,0,0,.08),
    0 18px 40px -12px rgba(0,0,0,.55),
    0 40px 80px -30px rgba(0,0,0,.5);
  animation: pin 1s .4s cubic-bezier(.2,.8,.2,1) both;
}
/* notched corners, like a swing ticket */
.ticket::before, .ticket::after {
  content: "";
  position: absolute; top: 0;
  width: 22px; height: 22px;
  background: var(--navy);
}
.ticket::before { left: 0;  clip-path: polygon(0 0, 100% 0, 0 100%); }
.ticket::after  { right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.hole {
  position: absolute; top: 12px; left: 50%;
  width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.5), 0 0 0 3px #E6DDCB;
}
.hole::after {        /* the thread it hangs from */
  content: "";
  position: absolute; left: 5px; bottom: 6px;
  width: 1.5px; height: 90px;
  background: var(--thread);
  transform-origin: bottom;
  transform: rotate(4deg);
}

.t-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.t-no {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}
.t-no strong { font-weight: 400; font-style: italic; }

.t-fields { margin: 0 0 14px; }
.t-fields div { display: flex; gap: 8px; align-items: baseline; }
.t-fields dt { color: var(--ink-2); min-width: 64px; }
.t-fields dt::after { content: ":"; }
.t-fields dd { margin: 0; font-weight: 500; }

.t-steps { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--ink-2); display: grid; gap: 2px; }
.t-steps li {
  display: grid;
  grid-template-columns: 20px auto 1fr;
  align-items: baseline;
  gap: 6px;
  color: var(--ink-2);
}
.t-steps li::before { content: "○"; color: var(--ink-2); }
.t-steps li span { color: var(--ink); }
.t-steps li i { font-style: normal; font-size: 11px; text-align: right; }
.t-steps li.done::before { content: "✓"; color: var(--ink); }
.t-steps li.done span { text-decoration: line-through; text-decoration-color: rgba(21,32,74,.45); }
.t-steps li.now::before { content: "●"; color: var(--rust); animation: blink 1.6s ease-in-out infinite; }
.t-steps li.now span, .t-steps li.now i { color: var(--rust); font-weight: 500; }

.stamp {
  position: absolute;
  right: 14px; top: 62px;
  padding: 6px 12px;
  border: 2.5px double var(--rust);
  color: var(--rust);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  transform: rotate(-12deg);
  opacity: .82;
  mix-blend-mode: multiply;
  animation: stamp .35s 1.4s cubic-bezier(.3,1.6,.5,1) both;
}

.t-actions { display: grid; gap: 8px; margin-top: 20px; }
.btn {
  display: block;
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  transition: background .2s, color .2s;
}
.btn-ink  { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-ink:hover { background: transparent; color: var(--ink); }
.btn-line { border: 1px solid var(--ink); color: var(--ink); text-transform: none; letter-spacing: .06em; font-size: 12px; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
a:focus-visible { outline: 2px solid var(--thread); outline-offset: 3px; }

/* ---- footer ---- */
.foot {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 18px 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.fact p { margin: 6px 0 0; font-size: 13.5px; color: var(--cream-2); }
.fact a { color: var(--cream); border-bottom: 1px solid var(--line); }
.fact a:hover { border-color: var(--cream); }

/* ---- motion ---- */
@keyframes chalk-draw { to { stroke-dashoffset: 0; } }
@keyframes fade  { to { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes pin {
  from { opacity: 0; transform: translateY(-24px) rotate(4deg); }
  to   { opacity: 1; transform: rotate(-2.2deg); }
}
@keyframes stamp {
  from { opacity: 0; transform: scale(1.8) rotate(-12deg); }
  to   { opacity: .82; transform: scale(1) rotate(-12deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chalk .draw { stroke-dashoffset: 0; }
  .chalk .allow, .chalk .draw-fade, .scrawl text { opacity: 1; }
}

/* ---- tablets and phones ---- */
@media (max-width: 1100px) {
  .bench { grid-template-columns: 1fr; min-height: 0; }
  .pattern svg { max-height: none; max-width: 340px; }
}
@media (max-width: 860px) {
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .right { grid-template-columns: 1fr; }
  .pattern svg { max-width: 320px; }
  .ticket { margin-top: 28px; }
}
@media (max-width: 480px) {
  .top .arabic { font-size: 13px; }
  .top-left { visibility: hidden; }       /* phones: keep its space so the logo stays centred */
  .sig { height: 24px; }
  .ticket { padding: 32px 20px 22px; transform: rotate(-1.2deg); }
  .stamp { right: 10px; top: 56px; font-size: 11px; }
  .t-steps li i { font-size: 10px; }
}
