/* ==========================================================================
   Hany Farid — modernized stylesheet (semantic markup version)
   Type:  Space Grotesk (display/labels) + Inter (body)
   ========================================================================== */

:root {
  --paper:   #EDF0F3;
  --card:    #FFFFFF;
  --ink:     #1B2026;
  --muted:   #66707B;
  --accent:  #0E7490;
  --accent2: #0A5A70;
  --line:    #E3E8ED;
  --radius:  16px;
  --font-body:    'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

::selection      { background-color: var(--accent); color: #fff; }
::-moz-selection { background-color: var(--accent); color: #fff; }

body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 400px at 50% -100px, #FFFFFF 0%, rgba(255,255,255,0) 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Links ------------------------------------------------------------ */

a         { color: var(--accent); text-decoration: none;
            border-bottom: 1px solid rgba(14, 116, 144, 0.30);
            transition: color .15s ease, border-color .15s ease,
                        background-color .15s ease; }
a:visited { color: var(--accent); }
a:hover   { color: var(--accent2); border-bottom-color: var(--accent2);
            background-color: rgba(14, 116, 144, 0.06); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px;
                  border-radius: 2px; }

.sep { color: #C2CAD2; margin: 0 2px; }
.clearfix { clear: both; }

/* ---- Card container ----------------------------------------------------- */

#wrapper {
  margin: 32px auto 64px;
  max-width: 920px;
  width: 100%;
  padding: 0 16px;
}

#main-content {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.05),
    0 16px 40px -12px rgba(16, 24, 40, 0.12);
  overflow: hidden;
}

/* ---- Hero: portrait + name band, index below ------------------------------ */

.masthead-grid { padding: 36px 40px 14px; }

.hero {
  display: flex;
  align-items: center;
  gap: 32px;
}

#hanypic { flex: 0 0 190px; }
#hanypic img {
  border-radius: 18px;
  box-shadow: 0 10px 28px -10px rgba(16, 24, 40, 0.35);
  width: 100%;
  height: auto;
  display: block;
}
#hanypic figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.masthead { min-width: 0; }
.masthead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--ink);
}

.pronounce      { color: var(--muted); font-size: 14px; margin-top: 8px; }
.pronounce i    { font-style: italic; }
.masthead-links { margin-top: 14px; }

hr.rule {
  border: none;
  height: 2px;
  margin: 24px 0 22px;
  background: linear-gradient(90deg, var(--accent) 0%,
              rgba(14,116,144,0.25) 45%, rgba(14,116,144,0) 100%);
}

/* Index: label column + full-width content column */
dl.index {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 22px;
  row-gap: 4px;
  align-items: baseline;
}

dl.index dt {
  grid-column: 1;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-top: 3px;
}
dl.index dt:not(:first-of-type) { margin-top: 18px; }

dl.index dd { grid-column: 2; }
dl.index dt:not(:first-of-type) + dd { margin-top: 18px; }
dl.index i  { color: var(--muted); }

/* ---- Lists ----------------------------------------------------------------- */

ul { list-style: none; }
ul li { margin: 0; }

ol { list-style: decimal outside; padding-left: 1.5em; }
ol li { margin: 0 0 0.6em 0; padding-left: 0.25em; }
ol li::marker {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.82em;
  font-weight: 500;
}

/* ---- Expandable panels (bio, papers, press, ...) ----------------------------- */

#about {
  padding: 20px 40px 40px;
  text-align: left;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

#block > div[id] {
  padding-top: 22px;
  line-height: 1.65;
}
#block i { color: var(--muted); }

/* Panel labels (BIO, TALKS, DIGITAL FORENSICS, ...) */
.panel-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}
/* labels were followed by a manual <br>; the block display replaces it */
.panel-label + br { display: none; }

/* Hidden until toggled; gentle reveal */
.hideClass { display: none; }
.hideClass.open { display: block; animation: panelIn .25s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

#topLink { padding: 14px 0 0; text-align: center; }
#topLink a { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.1em; }

/* ---- Misc / legacy (shared by other pages on this site) ---------------------- */

header { padding: 0; }
footer { padding: 24px 20px; }
pre    { overflow: auto; }

nav        { background: var(--ink); padding: 0; margin: 10px 0; border-radius: 10px; overflow: hidden; }
nav a      { color: #F9F9F9; display: block; float: left; padding: 10px 14px; border-bottom: none; }
nav a:visited { color: #F9F9F9; }
nav a:hover   { text-decoration: none; background: var(--accent); }

.left-col { width: 35%; float: right; text-align: left; }
.sidebar  { width: 65%; float: left; margin-bottom: 10px; text-align: left; }

.bgimg {
  background-image: url('./images/shark-attack-crop.jpg');
  background-repeat: no-repeat;
}

/* Content tables inside preserved panels */
#block table { border-collapse: collapse; }
#block td    { padding: 4px 10px 4px 0; vertical-align: top; }

/* ==========================================================================
   Tutorial subpages (learnComputerVision, learnPython, ...)
   These pages keep their original HTML (inline styles included), so a few
   overrides below neutralize legacy inline colors and fonts.
   ========================================================================== */

/* Inline body font + legacy gray backgrounds → design system */
body { font-family: var(--font-body) !important; font-size: 15.5px !important; }

section#main-content { background-color: var(--card) !important; }
#main-content section,
#main-content aside { background-color: transparent !important; }

/* Legacy <font color> tags → ink */
#block font { color: var(--ink) !important; }

/* Two-column layout: screenshots left (40%), outline right (60%) */
#latest { display: flow-root; }
.left-col { width: 60%; float: right; padding: 34px 40px 28px 14px; }
.sidebar  { width: 40%; float: left;  padding: 34px 14px 28px 40px; }

/* Content cards */
.left-col #block,
.sidebar #block { padding: 0 0 18px; border: none; box-shadow: none; }

/* Page title: first bold line of the first block */
.left-col > div#block:first-child font > b {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--ink) !important;
  margin-bottom: 2px;
}
.left-col > div#block:first-child { padding-bottom: 6px; }
.left-col > div#block:first-child::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 20px;
  background: linear-gradient(90deg, var(--accent) 0%,
              rgba(14,116,144,0.25) 45%, rgba(14,116,144,0) 100%);
}

/* Section heading ("Computer Vision") on subsequent blocks */
.left-col #block > font > b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted) !important;
}
.left-col > div#block:first-child font > b { font-size: 26px; letter-spacing: 0.04em; color: var(--ink) !important; }

/* Course outline: nested lists */
.left-col ul       { list-style: none; }
.left-col ul ul    { padding-left: 20px; }
.left-col li       { margin: 2px 0; }
.left-col li > b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

/* Screenshot column */
.sidebar img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px -8px rgba(16, 24, 40, 0.25);
  margin: 10px 0;
}
